All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] xen: use pkg-config for configure
@ 2017-03-16 14:19 ` Juergen Gross
  0 siblings, 0 replies; 40+ messages in thread
From: Juergen Gross @ 2017-03-16 14:19 UTC (permalink / raw)
  To: qemu-devel, xen-devel
  Cc: anthony.perard, kraxel, sstabellini, paul.durrant, Juergen Gross

This small patch set is to be applied on top of Paul's series for
support of libxendevicemodel, or (maybe even better) it should be
merged into this series.

Juergen Gross (2):
  xen: use 5 digit xen versions
  configure: use pkg-config for obtaining xen version

 configure                   | 43 +++++++++++++++++--------------------------
 hw/block/xen_disk.c         |  2 +-
 include/hw/xen/xen_common.h | 22 +++++++++++-----------
 3 files changed, 29 insertions(+), 38 deletions(-)

-- 
2.10.2

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [PATCH 0/2] xen: use pkg-config for configure
@ 2017-03-16 14:19 ` Juergen Gross
  0 siblings, 0 replies; 40+ messages in thread
From: Juergen Gross @ 2017-03-16 14:19 UTC (permalink / raw)
  To: qemu-devel, xen-devel
  Cc: anthony.perard, Juergen Gross, sstabellini, kraxel, paul.durrant

This small patch set is to be applied on top of Paul's series for
support of libxendevicemodel, or (maybe even better) it should be
merged into this series.

Juergen Gross (2):
  xen: use 5 digit xen versions
  configure: use pkg-config for obtaining xen version

 configure                   | 43 +++++++++++++++++--------------------------
 hw/block/xen_disk.c         |  2 +-
 include/hw/xen/xen_common.h | 22 +++++++++++-----------
 3 files changed, 29 insertions(+), 38 deletions(-)

-- 
2.10.2


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH 1/2] xen: use 5 digit xen versions
  2017-03-16 14:19 ` Juergen Gross
@ 2017-03-16 14:19   ` Juergen Gross
  -1 siblings, 0 replies; 40+ messages in thread
From: Juergen Gross @ 2017-03-16 14:19 UTC (permalink / raw)
  To: qemu-devel, xen-devel
  Cc: anthony.perard, kraxel, sstabellini, paul.durrant, Juergen Gross

Today qemu is using e.g. the value 480 for Xen version 4.8.0. As some
Xen version tests are using ">" relations this scheme will lead to
problems when Xen version 4.10.0 is being reached.

Instead of the 3 digit schem use a 5 digit scheme (e.g. 40800 for
version 4.8.0).

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 configure                   | 16 ++++++++--------
 hw/block/xen_disk.c         |  2 +-
 include/hw/xen/xen_common.h | 22 +++++++++++-----------
 3 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/configure b/configure
index b187222..aabf098 100755
--- a/configure
+++ b/configure
@@ -2001,7 +2001,7 @@ EOF
       compile_prog "" "$xen_libs $xen_stable_libs -lxendevicemodel"
     then
     xen_stable_libs="$xen_stable_libs -lxendevicemodel"
-    xen_ctrl_version=490
+    xen_ctrl_version=40900
     xen=yes
   elif
       cat > $TMPC <<EOF &&
@@ -2056,7 +2056,7 @@ int main(void) {
 EOF
       compile_prog "" "$xen_libs $xen_stable_libs"
     then
-    xen_ctrl_version=480
+    xen_ctrl_version=40800
     xen=yes
   elif
       cat > $TMPC <<EOF &&
@@ -2107,7 +2107,7 @@ int main(void) {
 EOF
       compile_prog "" "$xen_libs $xen_stable_libs"
     then
-    xen_ctrl_version=471
+    xen_ctrl_version=40701
     xen=yes
   elif
       cat > $TMPC <<EOF &&
@@ -2122,7 +2122,7 @@ int main(void) {
 EOF
       compile_prog "" "$xen_libs"
     then
-    xen_ctrl_version=470
+    xen_ctrl_version=40700
     xen=yes
 
   # Xen 4.6
@@ -2150,7 +2150,7 @@ int main(void) {
 EOF
       compile_prog "" "$xen_libs"
     then
-    xen_ctrl_version=460
+    xen_ctrl_version=40600
     xen=yes
 
   # Xen 4.5
@@ -2177,7 +2177,7 @@ int main(void) {
 EOF
       compile_prog "" "$xen_libs"
     then
-    xen_ctrl_version=450
+    xen_ctrl_version=40500
     xen=yes
 
   elif
@@ -2202,7 +2202,7 @@ int main(void) {
 EOF
       compile_prog "" "$xen_libs"
     then
-    xen_ctrl_version=420
+    xen_ctrl_version=40200
     xen=yes
 
   else
@@ -2214,7 +2214,7 @@ EOF
   fi
 
   if test "$xen" = yes; then
-    if test $xen_ctrl_version -ge 471  ; then
+    if test $xen_ctrl_version -ge 40701  ; then
       libs_softmmu="$xen_stable_libs $libs_softmmu"
     fi
     libs_softmmu="$xen_libs $libs_softmmu"
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 456a2d5..27df048 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -492,7 +492,7 @@ static int ioreq_map(struct ioreq *ioreq)
     return 0;
 }
 
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 480
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40800
 
 static void ioreq_free_copy_buffers(struct ioreq *ioreq)
 {
diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h
index 274accc..df098c7 100644
--- a/include/hw/xen/xen_common.h
+++ b/include/hw/xen/xen_common.h
@@ -27,7 +27,7 @@ extern xc_interface *xen_xc;
  * We don't support Xen prior to 4.2.0.
  */
 
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 490
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40900
 
 typedef xc_interface xendevicemodel_handle;
 
@@ -37,7 +37,7 @@ static inline xendevicemodel_handle *xendevicemodel_open(
     return xen_xc;
 }
 
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 450
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40500
 
 static inline int xendevicemodel_create_ioreq_server(
     xendevicemodel_handle *dmod, domid_t domid, int handle_bufioreq,
@@ -100,7 +100,7 @@ static inline int xendevicemodel_set_ioreq_server_state(
     return xc_hvm_set_ioreq_server_state(dmod, domid, id, enabled);
 }
 
-#endif /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 450 */
+#endif /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40500 */
 
 static inline int xendevicemodel_set_pci_intx_level(
     xendevicemodel_handle *dmod, domid_t domid, uint16_t segment,
@@ -152,7 +152,7 @@ static inline int xendevicemodel_set_mem_type(
     return xc_hvm_set_mem_type(dmod, domid, mem_type, first_pfn, nr);
 }
 
-#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 490 */
+#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40900 */
 
 #include <xendevicemodel.h>
 
@@ -207,7 +207,7 @@ static inline int xen_modified_memory(domid_t domid, uint64_t first_pfn,
 }
 
 /* Xen 4.2 through 4.6 */
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 471
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40701
 
 typedef xc_interface xenforeignmemory_handle;
 typedef xc_evtchn xenevtchn_handle;
@@ -248,7 +248,7 @@ static inline void *xenforeignmemory_map(xc_interface *h, uint32_t dom,
 
 #define xenforeignmemory_unmap(h, p, s) munmap(p, s * XC_PAGE_SIZE)
 
-#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 471 */
+#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40701 */
 
 #include <xenevtchn.h>
 #include <xengnttab.h>
@@ -284,7 +284,7 @@ static inline int xen_get_vmport_regs_pfn(xc_interface *xc, domid_t dom,
 #endif
 
 /* Xen before 4.6 */
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 460
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40600
 
 #ifndef HVM_IOREQSRV_BUFIOREQ_ATOMIC
 #define HVM_IOREQSRV_BUFIOREQ_ATOMIC 2
@@ -330,7 +330,7 @@ static inline int xen_get_default_ioreq_server_info(domid_t dom,
 }
 
 /* Xen before 4.5 */
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 450
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40500
 
 #ifndef HVM_PARAM_BUFIOREQ_EVTCHN
 #define HVM_PARAM_BUFIOREQ_EVTCHN 26
@@ -569,7 +569,7 @@ static inline int xen_set_ioreq_server_state(domid_t dom,
 
 #endif
 
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 460
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40600
 static inline int xen_xc_domain_add_to_physmap(xc_interface *xch, uint32_t domid,
                                                unsigned int space,
                                                unsigned long idx,
@@ -592,7 +592,7 @@ static inline int xen_xc_domain_add_to_physmap(xc_interface *xch, uint32_t domid
 #endif
 
 #ifdef CONFIG_XEN_PV_DOMAIN_BUILD
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 470
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40700
 static inline int xen_domain_create(xc_interface *xc, uint32_t ssidref,
                                     xen_domain_handle_t handle, uint32_t flags,
                                     uint32_t *pdomid)
@@ -611,7 +611,7 @@ static inline int xen_domain_create(xc_interface *xc, uint32_t ssidref,
 
 /* Xen before 4.8 */
 
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 480
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40800
 
 
 typedef void *xengnttab_grant_copy_segment_t;
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 1/2] xen: use 5 digit xen versions
@ 2017-03-16 14:19   ` Juergen Gross
  0 siblings, 0 replies; 40+ messages in thread
From: Juergen Gross @ 2017-03-16 14:19 UTC (permalink / raw)
  To: qemu-devel, xen-devel
  Cc: anthony.perard, Juergen Gross, sstabellini, kraxel, paul.durrant

Today qemu is using e.g. the value 480 for Xen version 4.8.0. As some
Xen version tests are using ">" relations this scheme will lead to
problems when Xen version 4.10.0 is being reached.

Instead of the 3 digit schem use a 5 digit scheme (e.g. 40800 for
version 4.8.0).

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 configure                   | 16 ++++++++--------
 hw/block/xen_disk.c         |  2 +-
 include/hw/xen/xen_common.h | 22 +++++++++++-----------
 3 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/configure b/configure
index b187222..aabf098 100755
--- a/configure
+++ b/configure
@@ -2001,7 +2001,7 @@ EOF
       compile_prog "" "$xen_libs $xen_stable_libs -lxendevicemodel"
     then
     xen_stable_libs="$xen_stable_libs -lxendevicemodel"
-    xen_ctrl_version=490
+    xen_ctrl_version=40900
     xen=yes
   elif
       cat > $TMPC <<EOF &&
@@ -2056,7 +2056,7 @@ int main(void) {
 EOF
       compile_prog "" "$xen_libs $xen_stable_libs"
     then
-    xen_ctrl_version=480
+    xen_ctrl_version=40800
     xen=yes
   elif
       cat > $TMPC <<EOF &&
@@ -2107,7 +2107,7 @@ int main(void) {
 EOF
       compile_prog "" "$xen_libs $xen_stable_libs"
     then
-    xen_ctrl_version=471
+    xen_ctrl_version=40701
     xen=yes
   elif
       cat > $TMPC <<EOF &&
@@ -2122,7 +2122,7 @@ int main(void) {
 EOF
       compile_prog "" "$xen_libs"
     then
-    xen_ctrl_version=470
+    xen_ctrl_version=40700
     xen=yes
 
   # Xen 4.6
@@ -2150,7 +2150,7 @@ int main(void) {
 EOF
       compile_prog "" "$xen_libs"
     then
-    xen_ctrl_version=460
+    xen_ctrl_version=40600
     xen=yes
 
   # Xen 4.5
@@ -2177,7 +2177,7 @@ int main(void) {
 EOF
       compile_prog "" "$xen_libs"
     then
-    xen_ctrl_version=450
+    xen_ctrl_version=40500
     xen=yes
 
   elif
@@ -2202,7 +2202,7 @@ int main(void) {
 EOF
       compile_prog "" "$xen_libs"
     then
-    xen_ctrl_version=420
+    xen_ctrl_version=40200
     xen=yes
 
   else
@@ -2214,7 +2214,7 @@ EOF
   fi
 
   if test "$xen" = yes; then
-    if test $xen_ctrl_version -ge 471  ; then
+    if test $xen_ctrl_version -ge 40701  ; then
       libs_softmmu="$xen_stable_libs $libs_softmmu"
     fi
     libs_softmmu="$xen_libs $libs_softmmu"
diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
index 456a2d5..27df048 100644
--- a/hw/block/xen_disk.c
+++ b/hw/block/xen_disk.c
@@ -492,7 +492,7 @@ static int ioreq_map(struct ioreq *ioreq)
     return 0;
 }
 
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 480
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40800
 
 static void ioreq_free_copy_buffers(struct ioreq *ioreq)
 {
diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h
index 274accc..df098c7 100644
--- a/include/hw/xen/xen_common.h
+++ b/include/hw/xen/xen_common.h
@@ -27,7 +27,7 @@ extern xc_interface *xen_xc;
  * We don't support Xen prior to 4.2.0.
  */
 
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 490
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40900
 
 typedef xc_interface xendevicemodel_handle;
 
@@ -37,7 +37,7 @@ static inline xendevicemodel_handle *xendevicemodel_open(
     return xen_xc;
 }
 
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 450
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40500
 
 static inline int xendevicemodel_create_ioreq_server(
     xendevicemodel_handle *dmod, domid_t domid, int handle_bufioreq,
@@ -100,7 +100,7 @@ static inline int xendevicemodel_set_ioreq_server_state(
     return xc_hvm_set_ioreq_server_state(dmod, domid, id, enabled);
 }
 
-#endif /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 450 */
+#endif /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40500 */
 
 static inline int xendevicemodel_set_pci_intx_level(
     xendevicemodel_handle *dmod, domid_t domid, uint16_t segment,
@@ -152,7 +152,7 @@ static inline int xendevicemodel_set_mem_type(
     return xc_hvm_set_mem_type(dmod, domid, mem_type, first_pfn, nr);
 }
 
-#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 490 */
+#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40900 */
 
 #include <xendevicemodel.h>
 
@@ -207,7 +207,7 @@ static inline int xen_modified_memory(domid_t domid, uint64_t first_pfn,
 }
 
 /* Xen 4.2 through 4.6 */
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 471
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40701
 
 typedef xc_interface xenforeignmemory_handle;
 typedef xc_evtchn xenevtchn_handle;
@@ -248,7 +248,7 @@ static inline void *xenforeignmemory_map(xc_interface *h, uint32_t dom,
 
 #define xenforeignmemory_unmap(h, p, s) munmap(p, s * XC_PAGE_SIZE)
 
-#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 471 */
+#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40701 */
 
 #include <xenevtchn.h>
 #include <xengnttab.h>
@@ -284,7 +284,7 @@ static inline int xen_get_vmport_regs_pfn(xc_interface *xc, domid_t dom,
 #endif
 
 /* Xen before 4.6 */
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 460
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40600
 
 #ifndef HVM_IOREQSRV_BUFIOREQ_ATOMIC
 #define HVM_IOREQSRV_BUFIOREQ_ATOMIC 2
@@ -330,7 +330,7 @@ static inline int xen_get_default_ioreq_server_info(domid_t dom,
 }
 
 /* Xen before 4.5 */
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 450
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40500
 
 #ifndef HVM_PARAM_BUFIOREQ_EVTCHN
 #define HVM_PARAM_BUFIOREQ_EVTCHN 26
@@ -569,7 +569,7 @@ static inline int xen_set_ioreq_server_state(domid_t dom,
 
 #endif
 
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 460
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40600
 static inline int xen_xc_domain_add_to_physmap(xc_interface *xch, uint32_t domid,
                                                unsigned int space,
                                                unsigned long idx,
@@ -592,7 +592,7 @@ static inline int xen_xc_domain_add_to_physmap(xc_interface *xch, uint32_t domid
 #endif
 
 #ifdef CONFIG_XEN_PV_DOMAIN_BUILD
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 470
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40700
 static inline int xen_domain_create(xc_interface *xc, uint32_t ssidref,
                                     xen_domain_handle_t handle, uint32_t flags,
                                     uint32_t *pdomid)
@@ -611,7 +611,7 @@ static inline int xen_domain_create(xc_interface *xc, uint32_t ssidref,
 
 /* Xen before 4.8 */
 
-#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 480
+#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40800
 
 
 typedef void *xengnttab_grant_copy_segment_t;
-- 
2.10.2


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version
  2017-03-16 14:19 ` Juergen Gross
@ 2017-03-16 14:19   ` Juergen Gross
  -1 siblings, 0 replies; 40+ messages in thread
From: Juergen Gross @ 2017-03-16 14:19 UTC (permalink / raw)
  To: qemu-devel, xen-devel
  Cc: anthony.perard, kraxel, sstabellini, paul.durrant, Juergen Gross

Instead of trying to guess the Xen version to use by compiling various
test programs first just ask the system via pkg-config. Only if it
can't return the version fall back to the test program scheme.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 configure | 31 +++++++++++--------------------
 1 file changed, 11 insertions(+), 20 deletions(-)

diff --git a/configure b/configure
index aabf098..b43fbd5 100755
--- a/configure
+++ b/configure
@@ -1983,26 +1983,12 @@ EOF
     fi
     xen=no
 
-  # Xen unstable
-  elif
-      cat > $TMPC <<EOF &&
-#undef XC_WANT_COMPAT_DEVICEMODEL_API
-#define __XEN_TOOLS__
-#include <xendevicemodel.h>
-int main(void) {
-  xendevicemodel_handle *xd;
-
-  xd = xendevicemodel_open(0, 0);
-  xendevicemodel_close(xd);
-
-  return 0;
-}
-EOF
-      compile_prog "" "$xen_libs $xen_stable_libs -lxendevicemodel"
-    then
-    xen_stable_libs="$xen_stable_libs -lxendevicemodel"
-    xen_ctrl_version=40900
+  # Xen version via pkg-config (Xen 4.9.0 and newer)
+  elif $pkg_config --exists xencontrol ; then
+    xen_ctrl_version="$(printf '%d%02d%02d' \
+      $($pkg_config --modversion xencontrol | sed 's/\./ /g') )"
     xen=yes
+
   elif
       cat > $TMPC <<EOF &&
 /*
@@ -2214,7 +2200,12 @@ EOF
   fi
 
   if test "$xen" = yes; then
-    if test $xen_ctrl_version -ge 40701  ; then
+    if test $xen_ctrl_version -ge 40900 ; then
+      xen_pc="xencontrol xenstore xenguest xenforeignmemory xengnttab xenevtchn"
+      xen_pc="$xen_pc xendevicemodel"
+      xen_libs="$($pkg_config --libs $xen_pc)"
+      QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)"
+    elif test $xen_ctrl_version -ge 40701 ; then
       libs_softmmu="$xen_stable_libs $libs_softmmu"
     fi
     libs_softmmu="$xen_libs $libs_softmmu"
-- 
2.10.2

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* [PATCH 2/2] configure: use pkg-config for obtaining xen version
@ 2017-03-16 14:19   ` Juergen Gross
  0 siblings, 0 replies; 40+ messages in thread
From: Juergen Gross @ 2017-03-16 14:19 UTC (permalink / raw)
  To: qemu-devel, xen-devel
  Cc: anthony.perard, Juergen Gross, sstabellini, kraxel, paul.durrant

Instead of trying to guess the Xen version to use by compiling various
test programs first just ask the system via pkg-config. Only if it
can't return the version fall back to the test program scheme.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 configure | 31 +++++++++++--------------------
 1 file changed, 11 insertions(+), 20 deletions(-)

diff --git a/configure b/configure
index aabf098..b43fbd5 100755
--- a/configure
+++ b/configure
@@ -1983,26 +1983,12 @@ EOF
     fi
     xen=no
 
-  # Xen unstable
-  elif
-      cat > $TMPC <<EOF &&
-#undef XC_WANT_COMPAT_DEVICEMODEL_API
-#define __XEN_TOOLS__
-#include <xendevicemodel.h>
-int main(void) {
-  xendevicemodel_handle *xd;
-
-  xd = xendevicemodel_open(0, 0);
-  xendevicemodel_close(xd);
-
-  return 0;
-}
-EOF
-      compile_prog "" "$xen_libs $xen_stable_libs -lxendevicemodel"
-    then
-    xen_stable_libs="$xen_stable_libs -lxendevicemodel"
-    xen_ctrl_version=40900
+  # Xen version via pkg-config (Xen 4.9.0 and newer)
+  elif $pkg_config --exists xencontrol ; then
+    xen_ctrl_version="$(printf '%d%02d%02d' \
+      $($pkg_config --modversion xencontrol | sed 's/\./ /g') )"
     xen=yes
+
   elif
       cat > $TMPC <<EOF &&
 /*
@@ -2214,7 +2200,12 @@ EOF
   fi
 
   if test "$xen" = yes; then
-    if test $xen_ctrl_version -ge 40701  ; then
+    if test $xen_ctrl_version -ge 40900 ; then
+      xen_pc="xencontrol xenstore xenguest xenforeignmemory xengnttab xenevtchn"
+      xen_pc="$xen_pc xendevicemodel"
+      xen_libs="$($pkg_config --libs $xen_pc)"
+      QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)"
+    elif test $xen_ctrl_version -ge 40701 ; then
       libs_softmmu="$xen_stable_libs $libs_softmmu"
     fi
     libs_softmmu="$xen_libs $libs_softmmu"
-- 
2.10.2


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] xen: use 5 digit xen versions
  2017-03-16 14:19   ` Juergen Gross
@ 2017-03-16 20:19     ` Stefano Stabellini
  -1 siblings, 0 replies; 40+ messages in thread
From: Stefano Stabellini @ 2017-03-16 20:19 UTC (permalink / raw)
  To: Juergen Gross
  Cc: qemu-devel, xen-devel, anthony.perard, kraxel, sstabellini, paul.durrant

On Thu, 16 Mar 2017, Juergen Gross wrote:
> Today qemu is using e.g. the value 480 for Xen version 4.8.0. As some
> Xen version tests are using ">" relations this scheme will lead to
> problems when Xen version 4.10.0 is being reached.
> 
> Instead of the 3 digit schem use a 5 digit scheme (e.g. 40800 for
> version 4.8.0).
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  configure                   | 16 ++++++++--------
>  hw/block/xen_disk.c         |  2 +-
>  include/hw/xen/xen_common.h | 22 +++++++++++-----------
>  3 files changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/configure b/configure
> index b187222..aabf098 100755
> --- a/configure
> +++ b/configure
> @@ -2001,7 +2001,7 @@ EOF
>        compile_prog "" "$xen_libs $xen_stable_libs -lxendevicemodel"
>      then
>      xen_stable_libs="$xen_stable_libs -lxendevicemodel"
> -    xen_ctrl_version=490
> +    xen_ctrl_version=40900
>      xen=yes
>    elif
>        cat > $TMPC <<EOF &&
> @@ -2056,7 +2056,7 @@ int main(void) {
>  EOF
>        compile_prog "" "$xen_libs $xen_stable_libs"
>      then
> -    xen_ctrl_version=480
> +    xen_ctrl_version=40800
>      xen=yes
>    elif
>        cat > $TMPC <<EOF &&
> @@ -2107,7 +2107,7 @@ int main(void) {
>  EOF
>        compile_prog "" "$xen_libs $xen_stable_libs"
>      then
> -    xen_ctrl_version=471
> +    xen_ctrl_version=40701
>      xen=yes
>    elif
>        cat > $TMPC <<EOF &&
> @@ -2122,7 +2122,7 @@ int main(void) {
>  EOF
>        compile_prog "" "$xen_libs"
>      then
> -    xen_ctrl_version=470
> +    xen_ctrl_version=40700
>      xen=yes
>  
>    # Xen 4.6
> @@ -2150,7 +2150,7 @@ int main(void) {
>  EOF
>        compile_prog "" "$xen_libs"
>      then
> -    xen_ctrl_version=460
> +    xen_ctrl_version=40600
>      xen=yes
>  
>    # Xen 4.5
> @@ -2177,7 +2177,7 @@ int main(void) {
>  EOF
>        compile_prog "" "$xen_libs"
>      then
> -    xen_ctrl_version=450
> +    xen_ctrl_version=40500
>      xen=yes
>  
>    elif
> @@ -2202,7 +2202,7 @@ int main(void) {
>  EOF
>        compile_prog "" "$xen_libs"
>      then
> -    xen_ctrl_version=420
> +    xen_ctrl_version=40200
>      xen=yes
>  
>    else
> @@ -2214,7 +2214,7 @@ EOF
>    fi
>  
>    if test "$xen" = yes; then
> -    if test $xen_ctrl_version -ge 471  ; then
> +    if test $xen_ctrl_version -ge 40701  ; then
>        libs_softmmu="$xen_stable_libs $libs_softmmu"
>      fi
>      libs_softmmu="$xen_libs $libs_softmmu"
> diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
> index 456a2d5..27df048 100644
> --- a/hw/block/xen_disk.c
> +++ b/hw/block/xen_disk.c
> @@ -492,7 +492,7 @@ static int ioreq_map(struct ioreq *ioreq)
>      return 0;
>  }
>  
> -#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 480
> +#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40800
>  
>  static void ioreq_free_copy_buffers(struct ioreq *ioreq)
>  {
> diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h
> index 274accc..df098c7 100644
> --- a/include/hw/xen/xen_common.h
> +++ b/include/hw/xen/xen_common.h
> @@ -27,7 +27,7 @@ extern xc_interface *xen_xc;
>   * We don't support Xen prior to 4.2.0.
>   */
>  
> -#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 490
> +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40900
>  
>  typedef xc_interface xendevicemodel_handle;
>  
> @@ -37,7 +37,7 @@ static inline xendevicemodel_handle *xendevicemodel_open(
>      return xen_xc;
>  }
>  
> -#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 450
> +#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40500
>  
>  static inline int xendevicemodel_create_ioreq_server(
>      xendevicemodel_handle *dmod, domid_t domid, int handle_bufioreq,
> @@ -100,7 +100,7 @@ static inline int xendevicemodel_set_ioreq_server_state(
>      return xc_hvm_set_ioreq_server_state(dmod, domid, id, enabled);
>  }
>  
> -#endif /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 450 */
> +#endif /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40500 */
>  
>  static inline int xendevicemodel_set_pci_intx_level(
>      xendevicemodel_handle *dmod, domid_t domid, uint16_t segment,
> @@ -152,7 +152,7 @@ static inline int xendevicemodel_set_mem_type(
>      return xc_hvm_set_mem_type(dmod, domid, mem_type, first_pfn, nr);
>  }
>  
> -#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 490 */
> +#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40900 */
>  
>  #include <xendevicemodel.h>
>  
> @@ -207,7 +207,7 @@ static inline int xen_modified_memory(domid_t domid, uint64_t first_pfn,
>  }
>  
>  /* Xen 4.2 through 4.6 */
> -#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 471
> +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40701
>  
>  typedef xc_interface xenforeignmemory_handle;
>  typedef xc_evtchn xenevtchn_handle;
> @@ -248,7 +248,7 @@ static inline void *xenforeignmemory_map(xc_interface *h, uint32_t dom,
>  
>  #define xenforeignmemory_unmap(h, p, s) munmap(p, s * XC_PAGE_SIZE)
>  
> -#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 471 */
> +#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40701 */
>  
>  #include <xenevtchn.h>
>  #include <xengnttab.h>
> @@ -284,7 +284,7 @@ static inline int xen_get_vmport_regs_pfn(xc_interface *xc, domid_t dom,
>  #endif
>  
>  /* Xen before 4.6 */
> -#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 460
> +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40600
>  
>  #ifndef HVM_IOREQSRV_BUFIOREQ_ATOMIC
>  #define HVM_IOREQSRV_BUFIOREQ_ATOMIC 2
> @@ -330,7 +330,7 @@ static inline int xen_get_default_ioreq_server_info(domid_t dom,
>  }
>  
>  /* Xen before 4.5 */
> -#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 450
> +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40500
>  
>  #ifndef HVM_PARAM_BUFIOREQ_EVTCHN
>  #define HVM_PARAM_BUFIOREQ_EVTCHN 26
> @@ -569,7 +569,7 @@ static inline int xen_set_ioreq_server_state(domid_t dom,
>  
>  #endif
>  
> -#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 460
> +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40600
>  static inline int xen_xc_domain_add_to_physmap(xc_interface *xch, uint32_t domid,
>                                                 unsigned int space,
>                                                 unsigned long idx,
> @@ -592,7 +592,7 @@ static inline int xen_xc_domain_add_to_physmap(xc_interface *xch, uint32_t domid
>  #endif
>  
>  #ifdef CONFIG_XEN_PV_DOMAIN_BUILD
> -#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 470
> +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40700
>  static inline int xen_domain_create(xc_interface *xc, uint32_t ssidref,
>                                      xen_domain_handle_t handle, uint32_t flags,
>                                      uint32_t *pdomid)
> @@ -611,7 +611,7 @@ static inline int xen_domain_create(xc_interface *xc, uint32_t ssidref,
>  
>  /* Xen before 4.8 */
>  
> -#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 480
> +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40800
>  
>  
>  typedef void *xengnttab_grant_copy_segment_t;
> -- 
> 2.10.2
> 

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 1/2] xen: use 5 digit xen versions
@ 2017-03-16 20:19     ` Stefano Stabellini
  0 siblings, 0 replies; 40+ messages in thread
From: Stefano Stabellini @ 2017-03-16 20:19 UTC (permalink / raw)
  To: Juergen Gross
  Cc: sstabellini, qemu-devel, paul.durrant, kraxel, anthony.perard, xen-devel

On Thu, 16 Mar 2017, Juergen Gross wrote:
> Today qemu is using e.g. the value 480 for Xen version 4.8.0. As some
> Xen version tests are using ">" relations this scheme will lead to
> problems when Xen version 4.10.0 is being reached.
> 
> Instead of the 3 digit schem use a 5 digit scheme (e.g. 40800 for
> version 4.8.0).
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  configure                   | 16 ++++++++--------
>  hw/block/xen_disk.c         |  2 +-
>  include/hw/xen/xen_common.h | 22 +++++++++++-----------
>  3 files changed, 20 insertions(+), 20 deletions(-)
> 
> diff --git a/configure b/configure
> index b187222..aabf098 100755
> --- a/configure
> +++ b/configure
> @@ -2001,7 +2001,7 @@ EOF
>        compile_prog "" "$xen_libs $xen_stable_libs -lxendevicemodel"
>      then
>      xen_stable_libs="$xen_stable_libs -lxendevicemodel"
> -    xen_ctrl_version=490
> +    xen_ctrl_version=40900
>      xen=yes
>    elif
>        cat > $TMPC <<EOF &&
> @@ -2056,7 +2056,7 @@ int main(void) {
>  EOF
>        compile_prog "" "$xen_libs $xen_stable_libs"
>      then
> -    xen_ctrl_version=480
> +    xen_ctrl_version=40800
>      xen=yes
>    elif
>        cat > $TMPC <<EOF &&
> @@ -2107,7 +2107,7 @@ int main(void) {
>  EOF
>        compile_prog "" "$xen_libs $xen_stable_libs"
>      then
> -    xen_ctrl_version=471
> +    xen_ctrl_version=40701
>      xen=yes
>    elif
>        cat > $TMPC <<EOF &&
> @@ -2122,7 +2122,7 @@ int main(void) {
>  EOF
>        compile_prog "" "$xen_libs"
>      then
> -    xen_ctrl_version=470
> +    xen_ctrl_version=40700
>      xen=yes
>  
>    # Xen 4.6
> @@ -2150,7 +2150,7 @@ int main(void) {
>  EOF
>        compile_prog "" "$xen_libs"
>      then
> -    xen_ctrl_version=460
> +    xen_ctrl_version=40600
>      xen=yes
>  
>    # Xen 4.5
> @@ -2177,7 +2177,7 @@ int main(void) {
>  EOF
>        compile_prog "" "$xen_libs"
>      then
> -    xen_ctrl_version=450
> +    xen_ctrl_version=40500
>      xen=yes
>  
>    elif
> @@ -2202,7 +2202,7 @@ int main(void) {
>  EOF
>        compile_prog "" "$xen_libs"
>      then
> -    xen_ctrl_version=420
> +    xen_ctrl_version=40200
>      xen=yes
>  
>    else
> @@ -2214,7 +2214,7 @@ EOF
>    fi
>  
>    if test "$xen" = yes; then
> -    if test $xen_ctrl_version -ge 471  ; then
> +    if test $xen_ctrl_version -ge 40701  ; then
>        libs_softmmu="$xen_stable_libs $libs_softmmu"
>      fi
>      libs_softmmu="$xen_libs $libs_softmmu"
> diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c
> index 456a2d5..27df048 100644
> --- a/hw/block/xen_disk.c
> +++ b/hw/block/xen_disk.c
> @@ -492,7 +492,7 @@ static int ioreq_map(struct ioreq *ioreq)
>      return 0;
>  }
>  
> -#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 480
> +#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40800
>  
>  static void ioreq_free_copy_buffers(struct ioreq *ioreq)
>  {
> diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h
> index 274accc..df098c7 100644
> --- a/include/hw/xen/xen_common.h
> +++ b/include/hw/xen/xen_common.h
> @@ -27,7 +27,7 @@ extern xc_interface *xen_xc;
>   * We don't support Xen prior to 4.2.0.
>   */
>  
> -#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 490
> +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40900
>  
>  typedef xc_interface xendevicemodel_handle;
>  
> @@ -37,7 +37,7 @@ static inline xendevicemodel_handle *xendevicemodel_open(
>      return xen_xc;
>  }
>  
> -#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 450
> +#if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40500
>  
>  static inline int xendevicemodel_create_ioreq_server(
>      xendevicemodel_handle *dmod, domid_t domid, int handle_bufioreq,
> @@ -100,7 +100,7 @@ static inline int xendevicemodel_set_ioreq_server_state(
>      return xc_hvm_set_ioreq_server_state(dmod, domid, id, enabled);
>  }
>  
> -#endif /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 450 */
> +#endif /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40500 */
>  
>  static inline int xendevicemodel_set_pci_intx_level(
>      xendevicemodel_handle *dmod, domid_t domid, uint16_t segment,
> @@ -152,7 +152,7 @@ static inline int xendevicemodel_set_mem_type(
>      return xc_hvm_set_mem_type(dmod, domid, mem_type, first_pfn, nr);
>  }
>  
> -#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 490 */
> +#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40900 */
>  
>  #include <xendevicemodel.h>
>  
> @@ -207,7 +207,7 @@ static inline int xen_modified_memory(domid_t domid, uint64_t first_pfn,
>  }
>  
>  /* Xen 4.2 through 4.6 */
> -#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 471
> +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40701
>  
>  typedef xc_interface xenforeignmemory_handle;
>  typedef xc_evtchn xenevtchn_handle;
> @@ -248,7 +248,7 @@ static inline void *xenforeignmemory_map(xc_interface *h, uint32_t dom,
>  
>  #define xenforeignmemory_unmap(h, p, s) munmap(p, s * XC_PAGE_SIZE)
>  
> -#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 471 */
> +#else /* CONFIG_XEN_CTRL_INTERFACE_VERSION >= 40701 */
>  
>  #include <xenevtchn.h>
>  #include <xengnttab.h>
> @@ -284,7 +284,7 @@ static inline int xen_get_vmport_regs_pfn(xc_interface *xc, domid_t dom,
>  #endif
>  
>  /* Xen before 4.6 */
> -#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 460
> +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40600
>  
>  #ifndef HVM_IOREQSRV_BUFIOREQ_ATOMIC
>  #define HVM_IOREQSRV_BUFIOREQ_ATOMIC 2
> @@ -330,7 +330,7 @@ static inline int xen_get_default_ioreq_server_info(domid_t dom,
>  }
>  
>  /* Xen before 4.5 */
> -#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 450
> +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40500
>  
>  #ifndef HVM_PARAM_BUFIOREQ_EVTCHN
>  #define HVM_PARAM_BUFIOREQ_EVTCHN 26
> @@ -569,7 +569,7 @@ static inline int xen_set_ioreq_server_state(domid_t dom,
>  
>  #endif
>  
> -#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 460
> +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40600
>  static inline int xen_xc_domain_add_to_physmap(xc_interface *xch, uint32_t domid,
>                                                 unsigned int space,
>                                                 unsigned long idx,
> @@ -592,7 +592,7 @@ static inline int xen_xc_domain_add_to_physmap(xc_interface *xch, uint32_t domid
>  #endif
>  
>  #ifdef CONFIG_XEN_PV_DOMAIN_BUILD
> -#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 470
> +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40700
>  static inline int xen_domain_create(xc_interface *xc, uint32_t ssidref,
>                                      xen_domain_handle_t handle, uint32_t flags,
>                                      uint32_t *pdomid)
> @@ -611,7 +611,7 @@ static inline int xen_domain_create(xc_interface *xc, uint32_t ssidref,
>  
>  /* Xen before 4.8 */
>  
> -#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 480
> +#if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40800
>  
>  
>  typedef void *xengnttab_grant_copy_segment_t;
> -- 
> 2.10.2
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version
  2017-03-16 14:19   ` Juergen Gross
@ 2017-03-16 20:20     ` Stefano Stabellini
  -1 siblings, 0 replies; 40+ messages in thread
From: Stefano Stabellini @ 2017-03-16 20:20 UTC (permalink / raw)
  To: Juergen Gross
  Cc: qemu-devel, xen-devel, anthony.perard, kraxel, sstabellini, paul.durrant

On Thu, 16 Mar 2017, Juergen Gross wrote:
> Instead of trying to guess the Xen version to use by compiling various
> test programs first just ask the system via pkg-config. Only if it
> can't return the version fall back to the test program scheme.

That's OK, but why did you remove the Xen unstable test?


> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
>  configure | 31 +++++++++++--------------------
>  1 file changed, 11 insertions(+), 20 deletions(-)
> 
> diff --git a/configure b/configure
> index aabf098..b43fbd5 100755
> --- a/configure
> +++ b/configure
> @@ -1983,26 +1983,12 @@ EOF
>      fi
>      xen=no
>  
> -  # Xen unstable
> -  elif
> -      cat > $TMPC <<EOF &&
> -#undef XC_WANT_COMPAT_DEVICEMODEL_API
> -#define __XEN_TOOLS__
> -#include <xendevicemodel.h>
> -int main(void) {
> -  xendevicemodel_handle *xd;
> -
> -  xd = xendevicemodel_open(0, 0);
> -  xendevicemodel_close(xd);
> -
> -  return 0;
> -}
> -EOF
> -      compile_prog "" "$xen_libs $xen_stable_libs -lxendevicemodel"
> -    then
> -    xen_stable_libs="$xen_stable_libs -lxendevicemodel"
> -    xen_ctrl_version=40900
> +  # Xen version via pkg-config (Xen 4.9.0 and newer)
> +  elif $pkg_config --exists xencontrol ; then
> +    xen_ctrl_version="$(printf '%d%02d%02d' \
> +      $($pkg_config --modversion xencontrol | sed 's/\./ /g') )"
>      xen=yes
> +
>    elif
>        cat > $TMPC <<EOF &&
>  /*
> @@ -2214,7 +2200,12 @@ EOF
>    fi
>  
>    if test "$xen" = yes; then
> -    if test $xen_ctrl_version -ge 40701  ; then
> +    if test $xen_ctrl_version -ge 40900 ; then
> +      xen_pc="xencontrol xenstore xenguest xenforeignmemory xengnttab xenevtchn"
> +      xen_pc="$xen_pc xendevicemodel"
> +      xen_libs="$($pkg_config --libs $xen_pc)"
> +      QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)"
> +    elif test $xen_ctrl_version -ge 40701 ; then
>        libs_softmmu="$xen_stable_libs $libs_softmmu"
>      fi
>      libs_softmmu="$xen_libs $libs_softmmu"

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 2/2] configure: use pkg-config for obtaining xen version
@ 2017-03-16 20:20     ` Stefano Stabellini
  0 siblings, 0 replies; 40+ messages in thread
From: Stefano Stabellini @ 2017-03-16 20:20 UTC (permalink / raw)
  To: Juergen Gross
  Cc: sstabellini, qemu-devel, paul.durrant, kraxel, anthony.perard, xen-devel

On Thu, 16 Mar 2017, Juergen Gross wrote:
> Instead of trying to guess the Xen version to use by compiling various
> test programs first just ask the system via pkg-config. Only if it
> can't return the version fall back to the test program scheme.

That's OK, but why did you remove the Xen unstable test?


> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
>  configure | 31 +++++++++++--------------------
>  1 file changed, 11 insertions(+), 20 deletions(-)
> 
> diff --git a/configure b/configure
> index aabf098..b43fbd5 100755
> --- a/configure
> +++ b/configure
> @@ -1983,26 +1983,12 @@ EOF
>      fi
>      xen=no
>  
> -  # Xen unstable
> -  elif
> -      cat > $TMPC <<EOF &&
> -#undef XC_WANT_COMPAT_DEVICEMODEL_API
> -#define __XEN_TOOLS__
> -#include <xendevicemodel.h>
> -int main(void) {
> -  xendevicemodel_handle *xd;
> -
> -  xd = xendevicemodel_open(0, 0);
> -  xendevicemodel_close(xd);
> -
> -  return 0;
> -}
> -EOF
> -      compile_prog "" "$xen_libs $xen_stable_libs -lxendevicemodel"
> -    then
> -    xen_stable_libs="$xen_stable_libs -lxendevicemodel"
> -    xen_ctrl_version=40900
> +  # Xen version via pkg-config (Xen 4.9.0 and newer)
> +  elif $pkg_config --exists xencontrol ; then
> +    xen_ctrl_version="$(printf '%d%02d%02d' \
> +      $($pkg_config --modversion xencontrol | sed 's/\./ /g') )"
>      xen=yes
> +
>    elif
>        cat > $TMPC <<EOF &&
>  /*
> @@ -2214,7 +2200,12 @@ EOF
>    fi
>  
>    if test "$xen" = yes; then
> -    if test $xen_ctrl_version -ge 40701  ; then
> +    if test $xen_ctrl_version -ge 40900 ; then
> +      xen_pc="xencontrol xenstore xenguest xenforeignmemory xengnttab xenevtchn"
> +      xen_pc="$xen_pc xendevicemodel"
> +      xen_libs="$($pkg_config --libs $xen_pc)"
> +      QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)"
> +    elif test $xen_ctrl_version -ge 40701 ; then
>        libs_softmmu="$xen_stable_libs $libs_softmmu"
>      fi
>      libs_softmmu="$xen_libs $libs_softmmu"

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version
  2017-03-16 20:20     ` Stefano Stabellini
@ 2017-03-17  4:49       ` Juergen Gross
  -1 siblings, 0 replies; 40+ messages in thread
From: Juergen Gross @ 2017-03-17  4:49 UTC (permalink / raw)
  To: Stefano Stabellini
  Cc: qemu-devel, xen-devel, anthony.perard, kraxel, paul.durrant

On 16/03/17 21:20, Stefano Stabellini wrote:
> On Thu, 16 Mar 2017, Juergen Gross wrote:
>> Instead of trying to guess the Xen version to use by compiling various
>> test programs first just ask the system via pkg-config. Only if it
>> can't return the version fall back to the test program scheme.
> 
> That's OK, but why did you remove the Xen unstable test?

>From Xen 4.9 on pkg-config will return the needed information. There is
no longer a need for a test program to determine the Xen version. After
all this was the main objective of my series adding the pkg-config
files to Xen.


Juergen

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 2/2] configure: use pkg-config for obtaining xen version
@ 2017-03-17  4:49       ` Juergen Gross
  0 siblings, 0 replies; 40+ messages in thread
From: Juergen Gross @ 2017-03-17  4:49 UTC (permalink / raw)
  To: Stefano Stabellini
  Cc: anthony.perard, xen-devel, paul.durrant, qemu-devel, kraxel

On 16/03/17 21:20, Stefano Stabellini wrote:
> On Thu, 16 Mar 2017, Juergen Gross wrote:
>> Instead of trying to guess the Xen version to use by compiling various
>> test programs first just ask the system via pkg-config. Only if it
>> can't return the version fall back to the test program scheme.
> 
> That's OK, but why did you remove the Xen unstable test?

From Xen 4.9 on pkg-config will return the needed information. There is
no longer a need for a test program to determine the Xen version. After
all this was the main objective of my series adding the pkg-config
files to Xen.


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version
  2017-03-17  4:49       ` Juergen Gross
@ 2017-03-17 18:33         ` Stefano Stabellini
  -1 siblings, 0 replies; 40+ messages in thread
From: Stefano Stabellini @ 2017-03-17 18:33 UTC (permalink / raw)
  To: Juergen Gross
  Cc: Stefano Stabellini, qemu-devel, xen-devel, anthony.perard,
	kraxel, paul.durrant

On Fri, 17 Mar 2017, Juergen Gross wrote:
> On 16/03/17 21:20, Stefano Stabellini wrote:
> > On Thu, 16 Mar 2017, Juergen Gross wrote:
> >> Instead of trying to guess the Xen version to use by compiling various
> >> test programs first just ask the system via pkg-config. Only if it
> >> can't return the version fall back to the test program scheme.
> > 
> > That's OK, but why did you remove the Xen unstable test?
> 
> >From Xen 4.9 on pkg-config will return the needed information. There is
> no longer a need for a test program to determine the Xen version. After
> all this was the main objective of my series adding the pkg-config
> files to Xen.

I was going to say something like "yeah, but is pkg-config always
available?" In reality, QEMU already has pkg-config as build
dependency, so I guess there is no problem with that.

Please add a note about this to the commit message.

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 2/2] configure: use pkg-config for obtaining xen version
@ 2017-03-17 18:33         ` Stefano Stabellini
  0 siblings, 0 replies; 40+ messages in thread
From: Stefano Stabellini @ 2017-03-17 18:33 UTC (permalink / raw)
  To: Juergen Gross
  Cc: Stefano Stabellini, qemu-devel, paul.durrant, kraxel,
	anthony.perard, xen-devel

On Fri, 17 Mar 2017, Juergen Gross wrote:
> On 16/03/17 21:20, Stefano Stabellini wrote:
> > On Thu, 16 Mar 2017, Juergen Gross wrote:
> >> Instead of trying to guess the Xen version to use by compiling various
> >> test programs first just ask the system via pkg-config. Only if it
> >> can't return the version fall back to the test program scheme.
> > 
> > That's OK, but why did you remove the Xen unstable test?
> 
> >From Xen 4.9 on pkg-config will return the needed information. There is
> no longer a need for a test program to determine the Xen version. After
> all this was the main objective of my series adding the pkg-config
> files to Xen.

I was going to say something like "yeah, but is pkg-config always
available?" In reality, QEMU already has pkg-config as build
dependency, so I guess there is no problem with that.

Please add a note about this to the commit message.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version
  2017-03-17 18:33         ` Stefano Stabellini
@ 2017-03-21  5:34           ` Juergen Gross
  -1 siblings, 0 replies; 40+ messages in thread
From: Juergen Gross @ 2017-03-21  5:34 UTC (permalink / raw)
  To: Stefano Stabellini
  Cc: qemu-devel, xen-devel, anthony.perard, kraxel, paul.durrant

On 17/03/17 19:33, Stefano Stabellini wrote:
> On Fri, 17 Mar 2017, Juergen Gross wrote:
>> On 16/03/17 21:20, Stefano Stabellini wrote:
>>> On Thu, 16 Mar 2017, Juergen Gross wrote:
>>>> Instead of trying to guess the Xen version to use by compiling various
>>>> test programs first just ask the system via pkg-config. Only if it
>>>> can't return the version fall back to the test program scheme.
>>>
>>> That's OK, but why did you remove the Xen unstable test?
>>
>> >From Xen 4.9 on pkg-config will return the needed information. There is
>> no longer a need for a test program to determine the Xen version. After
>> all this was the main objective of my series adding the pkg-config
>> files to Xen.
> 
> I was going to say something like "yeah, but is pkg-config always
> available?" In reality, QEMU already has pkg-config as build
> dependency, so I guess there is no problem with that.
> 
> Please add a note about this to the commit message.
> 

Okay.


Juergen

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 2/2] configure: use pkg-config for obtaining xen version
@ 2017-03-21  5:34           ` Juergen Gross
  0 siblings, 0 replies; 40+ messages in thread
From: Juergen Gross @ 2017-03-21  5:34 UTC (permalink / raw)
  To: Stefano Stabellini
  Cc: anthony.perard, xen-devel, paul.durrant, qemu-devel, kraxel

On 17/03/17 19:33, Stefano Stabellini wrote:
> On Fri, 17 Mar 2017, Juergen Gross wrote:
>> On 16/03/17 21:20, Stefano Stabellini wrote:
>>> On Thu, 16 Mar 2017, Juergen Gross wrote:
>>>> Instead of trying to guess the Xen version to use by compiling various
>>>> test programs first just ask the system via pkg-config. Only if it
>>>> can't return the version fall back to the test program scheme.
>>>
>>> That's OK, but why did you remove the Xen unstable test?
>>
>> >From Xen 4.9 on pkg-config will return the needed information. There is
>> no longer a need for a test program to determine the Xen version. After
>> all this was the main objective of my series adding the pkg-config
>> files to Xen.
> 
> I was going to say something like "yeah, but is pkg-config always
> available?" In reality, QEMU already has pkg-config as build
> dependency, so I guess there is no problem with that.
> 
> Please add a note about this to the commit message.
> 

Okay.


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version
  2017-03-21  5:34           ` Juergen Gross
@ 2017-03-21 18:54             ` Stefano Stabellini
  -1 siblings, 0 replies; 40+ messages in thread
From: Stefano Stabellini @ 2017-03-21 18:54 UTC (permalink / raw)
  To: Juergen Gross
  Cc: Stefano Stabellini, qemu-devel, xen-devel, anthony.perard,
	kraxel, paul.durrant

On Tue, 21 Mar 2017, Juergen Gross wrote:
> On 17/03/17 19:33, Stefano Stabellini wrote:
> > On Fri, 17 Mar 2017, Juergen Gross wrote:
> >> On 16/03/17 21:20, Stefano Stabellini wrote:
> >>> On Thu, 16 Mar 2017, Juergen Gross wrote:
> >>>> Instead of trying to guess the Xen version to use by compiling various
> >>>> test programs first just ask the system via pkg-config. Only if it
> >>>> can't return the version fall back to the test program scheme.
> >>>
> >>> That's OK, but why did you remove the Xen unstable test?
> >>
> >> >From Xen 4.9 on pkg-config will return the needed information. There is
> >> no longer a need for a test program to determine the Xen version. After
> >> all this was the main objective of my series adding the pkg-config
> >> files to Xen.
> > 
> > I was going to say something like "yeah, but is pkg-config always
> > available?" In reality, QEMU already has pkg-config as build
> > dependency, so I guess there is no problem with that.
> > 
> > Please add a note about this to the commit message.
> > 
> 
> Okay.

Sorry to point this out only now, and I realize that it might be
unimportant for production builds, but it is important to me, and
developers in general, to be able to test a single QEMU tree against a
number of Xen trees (all releases from 4.3 onward).

With this change (specifically dropping the 4.9 build test), out of tree
builds don't work anymore. I would like to be able to do:

./configure --enable-xen --target-list=i386-softmmu \
                --extra-cflags="-I$DIR/tools/include \
                -I$DIR/tools/libs/toollog/include \
                -I$DIR/tools/libs/evtchn/include \
                -I$DIR/tools/libs/gnttab/include \
                -I$DIR/tools/libs/foreignmemory/include \
                -I$DIR/tools/libs/devicemodel/include \
                -I$DIR/tools/libxc/include \
                -I$DIR/tools/xenstore/include \
                -I$DIR/tools/xenstore/compat/include" \
                --extra-ldflags="-L$DIR/tools/libxc \
                -L$DIR/tools/xenstore \
                -L$DIR/tools/libs/evtchn \
                -L$DIR/tools/libs/gnttab \
                -L$DIR/tools/libs/foreignmemory \
                -L$DIR/tools/libs/devicemodel \
                -Wl,-rpath-link=$DIR/tools/libs/toollog \
                -Wl,-rpath-link=$DIR/tools/libs/evtchn \
                -Wl,-rpath-link=$DIR/tools/libs/gnttab \
                -Wl,-rpath-link=$DIR/tools/libs/call \
                -Wl,-rpath-link=$DIR/tools/libs/foreignmemory \
                -Wl,-rpath-link=$DIR/tools/libs/devicemodel" \
            --disable-kvm 
make

And the make should succeed. Is there a way to do that with pkg-config?
If not, I think we should keep the existing tests (and only add
pkg-config tests in addition to them, not in alternative).

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 2/2] configure: use pkg-config for obtaining xen version
@ 2017-03-21 18:54             ` Stefano Stabellini
  0 siblings, 0 replies; 40+ messages in thread
From: Stefano Stabellini @ 2017-03-21 18:54 UTC (permalink / raw)
  To: Juergen Gross
  Cc: Stefano Stabellini, qemu-devel, paul.durrant, kraxel,
	anthony.perard, xen-devel

On Tue, 21 Mar 2017, Juergen Gross wrote:
> On 17/03/17 19:33, Stefano Stabellini wrote:
> > On Fri, 17 Mar 2017, Juergen Gross wrote:
> >> On 16/03/17 21:20, Stefano Stabellini wrote:
> >>> On Thu, 16 Mar 2017, Juergen Gross wrote:
> >>>> Instead of trying to guess the Xen version to use by compiling various
> >>>> test programs first just ask the system via pkg-config. Only if it
> >>>> can't return the version fall back to the test program scheme.
> >>>
> >>> That's OK, but why did you remove the Xen unstable test?
> >>
> >> >From Xen 4.9 on pkg-config will return the needed information. There is
> >> no longer a need for a test program to determine the Xen version. After
> >> all this was the main objective of my series adding the pkg-config
> >> files to Xen.
> > 
> > I was going to say something like "yeah, but is pkg-config always
> > available?" In reality, QEMU already has pkg-config as build
> > dependency, so I guess there is no problem with that.
> > 
> > Please add a note about this to the commit message.
> > 
> 
> Okay.

Sorry to point this out only now, and I realize that it might be
unimportant for production builds, but it is important to me, and
developers in general, to be able to test a single QEMU tree against a
number of Xen trees (all releases from 4.3 onward).

With this change (specifically dropping the 4.9 build test), out of tree
builds don't work anymore. I would like to be able to do:

./configure --enable-xen --target-list=i386-softmmu \
                --extra-cflags="-I$DIR/tools/include \
                -I$DIR/tools/libs/toollog/include \
                -I$DIR/tools/libs/evtchn/include \
                -I$DIR/tools/libs/gnttab/include \
                -I$DIR/tools/libs/foreignmemory/include \
                -I$DIR/tools/libs/devicemodel/include \
                -I$DIR/tools/libxc/include \
                -I$DIR/tools/xenstore/include \
                -I$DIR/tools/xenstore/compat/include" \
                --extra-ldflags="-L$DIR/tools/libxc \
                -L$DIR/tools/xenstore \
                -L$DIR/tools/libs/evtchn \
                -L$DIR/tools/libs/gnttab \
                -L$DIR/tools/libs/foreignmemory \
                -L$DIR/tools/libs/devicemodel \
                -Wl,-rpath-link=$DIR/tools/libs/toollog \
                -Wl,-rpath-link=$DIR/tools/libs/evtchn \
                -Wl,-rpath-link=$DIR/tools/libs/gnttab \
                -Wl,-rpath-link=$DIR/tools/libs/call \
                -Wl,-rpath-link=$DIR/tools/libs/foreignmemory \
                -Wl,-rpath-link=$DIR/tools/libs/devicemodel" \
            --disable-kvm 
make

And the make should succeed. Is there a way to do that with pkg-config?
If not, I think we should keep the existing tests (and only add
pkg-config tests in addition to them, not in alternative).

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version
  2017-03-21 18:54             ` Stefano Stabellini
@ 2017-03-22  5:02               ` Juergen Gross
  -1 siblings, 0 replies; 40+ messages in thread
From: Juergen Gross @ 2017-03-22  5:02 UTC (permalink / raw)
  To: Stefano Stabellini
  Cc: qemu-devel, xen-devel, anthony.perard, kraxel, paul.durrant

On 21/03/17 19:54, Stefano Stabellini wrote:
> On Tue, 21 Mar 2017, Juergen Gross wrote:
>> On 17/03/17 19:33, Stefano Stabellini wrote:
>>> On Fri, 17 Mar 2017, Juergen Gross wrote:
>>>> On 16/03/17 21:20, Stefano Stabellini wrote:
>>>>> On Thu, 16 Mar 2017, Juergen Gross wrote:
>>>>>> Instead of trying to guess the Xen version to use by compiling various
>>>>>> test programs first just ask the system via pkg-config. Only if it
>>>>>> can't return the version fall back to the test program scheme.
>>>>>
>>>>> That's OK, but why did you remove the Xen unstable test?
>>>>
>>>> >From Xen 4.9 on pkg-config will return the needed information. There is
>>>> no longer a need for a test program to determine the Xen version. After
>>>> all this was the main objective of my series adding the pkg-config
>>>> files to Xen.
>>>
>>> I was going to say something like "yeah, but is pkg-config always
>>> available?" In reality, QEMU already has pkg-config as build
>>> dependency, so I guess there is no problem with that.
>>>
>>> Please add a note about this to the commit message.
>>>
>>
>> Okay.
> 
> Sorry to point this out only now, and I realize that it might be
> unimportant for production builds, but it is important to me, and
> developers in general, to be able to test a single QEMU tree against a
> number of Xen trees (all releases from 4.3 onward).
> 
> With this change (specifically dropping the 4.9 build test), out of tree
> builds don't work anymore. I would like to be able to do:
> 
> ./configure --enable-xen --target-list=i386-softmmu \
>                 --extra-cflags="-I$DIR/tools/include \
>                 -I$DIR/tools/libs/toollog/include \
>                 -I$DIR/tools/libs/evtchn/include \
>                 -I$DIR/tools/libs/gnttab/include \
>                 -I$DIR/tools/libs/foreignmemory/include \
>                 -I$DIR/tools/libs/devicemodel/include \
>                 -I$DIR/tools/libxc/include \
>                 -I$DIR/tools/xenstore/include \
>                 -I$DIR/tools/xenstore/compat/include" \
>                 --extra-ldflags="-L$DIR/tools/libxc \
>                 -L$DIR/tools/xenstore \
>                 -L$DIR/tools/libs/evtchn \
>                 -L$DIR/tools/libs/gnttab \
>                 -L$DIR/tools/libs/foreignmemory \
>                 -L$DIR/tools/libs/devicemodel \
>                 -Wl,-rpath-link=$DIR/tools/libs/toollog \
>                 -Wl,-rpath-link=$DIR/tools/libs/evtchn \
>                 -Wl,-rpath-link=$DIR/tools/libs/gnttab \
>                 -Wl,-rpath-link=$DIR/tools/libs/call \
>                 -Wl,-rpath-link=$DIR/tools/libs/foreignmemory \
>                 -Wl,-rpath-link=$DIR/tools/libs/devicemodel" \
>             --disable-kvm 
> make
> 
> And the make should succeed. Is there a way to do that with pkg-config?

Sure, for Xen 4.9 just do:

PKG_CONFIG_PATH=$(DIR)/tools/pkg-config ./configure \
		--enable-xen --target-list=i386-softmmu \
		--disable-kvm
make


Juergen

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 2/2] configure: use pkg-config for obtaining xen version
@ 2017-03-22  5:02               ` Juergen Gross
  0 siblings, 0 replies; 40+ messages in thread
From: Juergen Gross @ 2017-03-22  5:02 UTC (permalink / raw)
  To: Stefano Stabellini
  Cc: anthony.perard, xen-devel, paul.durrant, qemu-devel, kraxel

On 21/03/17 19:54, Stefano Stabellini wrote:
> On Tue, 21 Mar 2017, Juergen Gross wrote:
>> On 17/03/17 19:33, Stefano Stabellini wrote:
>>> On Fri, 17 Mar 2017, Juergen Gross wrote:
>>>> On 16/03/17 21:20, Stefano Stabellini wrote:
>>>>> On Thu, 16 Mar 2017, Juergen Gross wrote:
>>>>>> Instead of trying to guess the Xen version to use by compiling various
>>>>>> test programs first just ask the system via pkg-config. Only if it
>>>>>> can't return the version fall back to the test program scheme.
>>>>>
>>>>> That's OK, but why did you remove the Xen unstable test?
>>>>
>>>> >From Xen 4.9 on pkg-config will return the needed information. There is
>>>> no longer a need for a test program to determine the Xen version. After
>>>> all this was the main objective of my series adding the pkg-config
>>>> files to Xen.
>>>
>>> I was going to say something like "yeah, but is pkg-config always
>>> available?" In reality, QEMU already has pkg-config as build
>>> dependency, so I guess there is no problem with that.
>>>
>>> Please add a note about this to the commit message.
>>>
>>
>> Okay.
> 
> Sorry to point this out only now, and I realize that it might be
> unimportant for production builds, but it is important to me, and
> developers in general, to be able to test a single QEMU tree against a
> number of Xen trees (all releases from 4.3 onward).
> 
> With this change (specifically dropping the 4.9 build test), out of tree
> builds don't work anymore. I would like to be able to do:
> 
> ./configure --enable-xen --target-list=i386-softmmu \
>                 --extra-cflags="-I$DIR/tools/include \
>                 -I$DIR/tools/libs/toollog/include \
>                 -I$DIR/tools/libs/evtchn/include \
>                 -I$DIR/tools/libs/gnttab/include \
>                 -I$DIR/tools/libs/foreignmemory/include \
>                 -I$DIR/tools/libs/devicemodel/include \
>                 -I$DIR/tools/libxc/include \
>                 -I$DIR/tools/xenstore/include \
>                 -I$DIR/tools/xenstore/compat/include" \
>                 --extra-ldflags="-L$DIR/tools/libxc \
>                 -L$DIR/tools/xenstore \
>                 -L$DIR/tools/libs/evtchn \
>                 -L$DIR/tools/libs/gnttab \
>                 -L$DIR/tools/libs/foreignmemory \
>                 -L$DIR/tools/libs/devicemodel \
>                 -Wl,-rpath-link=$DIR/tools/libs/toollog \
>                 -Wl,-rpath-link=$DIR/tools/libs/evtchn \
>                 -Wl,-rpath-link=$DIR/tools/libs/gnttab \
>                 -Wl,-rpath-link=$DIR/tools/libs/call \
>                 -Wl,-rpath-link=$DIR/tools/libs/foreignmemory \
>                 -Wl,-rpath-link=$DIR/tools/libs/devicemodel" \
>             --disable-kvm 
> make
> 
> And the make should succeed. Is there a way to do that with pkg-config?

Sure, for Xen 4.9 just do:

PKG_CONFIG_PATH=$(DIR)/tools/pkg-config ./configure \
		--enable-xen --target-list=i386-softmmu \
		--disable-kvm
make


Juergen


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version
  2017-03-22  5:02               ` Juergen Gross
@ 2017-03-22 18:21                 ` Stefano Stabellini
  -1 siblings, 0 replies; 40+ messages in thread
From: Stefano Stabellini @ 2017-03-22 18:21 UTC (permalink / raw)
  To: Juergen Gross
  Cc: Stefano Stabellini, qemu-devel, xen-devel, anthony.perard,
	kraxel, paul.durrant

On Wed, 22 Mar 2017, Juergen Gross wrote:
> On 21/03/17 19:54, Stefano Stabellini wrote:
> > On Tue, 21 Mar 2017, Juergen Gross wrote:
> >> On 17/03/17 19:33, Stefano Stabellini wrote:
> >>> On Fri, 17 Mar 2017, Juergen Gross wrote:
> >>>> On 16/03/17 21:20, Stefano Stabellini wrote:
> >>>>> On Thu, 16 Mar 2017, Juergen Gross wrote:
> >>>>>> Instead of trying to guess the Xen version to use by compiling various
> >>>>>> test programs first just ask the system via pkg-config. Only if it
> >>>>>> can't return the version fall back to the test program scheme.
> >>>>>
> >>>>> That's OK, but why did you remove the Xen unstable test?
> >>>>
> >>>> >From Xen 4.9 on pkg-config will return the needed information. There is
> >>>> no longer a need for a test program to determine the Xen version. After
> >>>> all this was the main objective of my series adding the pkg-config
> >>>> files to Xen.
> >>>
> >>> I was going to say something like "yeah, but is pkg-config always
> >>> available?" In reality, QEMU already has pkg-config as build
> >>> dependency, so I guess there is no problem with that.
> >>>
> >>> Please add a note about this to the commit message.
> >>>
> >>
> >> Okay.
> > 
> > Sorry to point this out only now, and I realize that it might be
> > unimportant for production builds, but it is important to me, and
> > developers in general, to be able to test a single QEMU tree against a
> > number of Xen trees (all releases from 4.3 onward).
> > 
> > With this change (specifically dropping the 4.9 build test), out of tree
> > builds don't work anymore. I would like to be able to do:
> > 
> > ./configure --enable-xen --target-list=i386-softmmu \
> >                 --extra-cflags="-I$DIR/tools/include \
> >                 -I$DIR/tools/libs/toollog/include \
> >                 -I$DIR/tools/libs/evtchn/include \
> >                 -I$DIR/tools/libs/gnttab/include \
> >                 -I$DIR/tools/libs/foreignmemory/include \
> >                 -I$DIR/tools/libs/devicemodel/include \
> >                 -I$DIR/tools/libxc/include \
> >                 -I$DIR/tools/xenstore/include \
> >                 -I$DIR/tools/xenstore/compat/include" \
> >                 --extra-ldflags="-L$DIR/tools/libxc \
> >                 -L$DIR/tools/xenstore \
> >                 -L$DIR/tools/libs/evtchn \
> >                 -L$DIR/tools/libs/gnttab \
> >                 -L$DIR/tools/libs/foreignmemory \
> >                 -L$DIR/tools/libs/devicemodel \
> >                 -Wl,-rpath-link=$DIR/tools/libs/toollog \
> >                 -Wl,-rpath-link=$DIR/tools/libs/evtchn \
> >                 -Wl,-rpath-link=$DIR/tools/libs/gnttab \
> >                 -Wl,-rpath-link=$DIR/tools/libs/call \
> >                 -Wl,-rpath-link=$DIR/tools/libs/foreignmemory \
> >                 -Wl,-rpath-link=$DIR/tools/libs/devicemodel" \
> >             --disable-kvm 
> > make
> > 
> > And the make should succeed. Is there a way to do that with pkg-config?
> 
> Sure, for Xen 4.9 just do:
> 
> PKG_CONFIG_PATH=$(DIR)/tools/pkg-config ./configure \
> 		--enable-xen --target-list=i386-softmmu \
> 		--disable-kvm
> make

Yes, that works, thanks! I committed it to my next branch adding
"pkg-config, which is already a build dependency of QEMU, will be used
exclusively to determine the Xen version from Xen 4.9 onward." to the
commit message.

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 2/2] configure: use pkg-config for obtaining xen version
@ 2017-03-22 18:21                 ` Stefano Stabellini
  0 siblings, 0 replies; 40+ messages in thread
From: Stefano Stabellini @ 2017-03-22 18:21 UTC (permalink / raw)
  To: Juergen Gross
  Cc: Stefano Stabellini, qemu-devel, paul.durrant, kraxel,
	anthony.perard, xen-devel

On Wed, 22 Mar 2017, Juergen Gross wrote:
> On 21/03/17 19:54, Stefano Stabellini wrote:
> > On Tue, 21 Mar 2017, Juergen Gross wrote:
> >> On 17/03/17 19:33, Stefano Stabellini wrote:
> >>> On Fri, 17 Mar 2017, Juergen Gross wrote:
> >>>> On 16/03/17 21:20, Stefano Stabellini wrote:
> >>>>> On Thu, 16 Mar 2017, Juergen Gross wrote:
> >>>>>> Instead of trying to guess the Xen version to use by compiling various
> >>>>>> test programs first just ask the system via pkg-config. Only if it
> >>>>>> can't return the version fall back to the test program scheme.
> >>>>>
> >>>>> That's OK, but why did you remove the Xen unstable test?
> >>>>
> >>>> >From Xen 4.9 on pkg-config will return the needed information. There is
> >>>> no longer a need for a test program to determine the Xen version. After
> >>>> all this was the main objective of my series adding the pkg-config
> >>>> files to Xen.
> >>>
> >>> I was going to say something like "yeah, but is pkg-config always
> >>> available?" In reality, QEMU already has pkg-config as build
> >>> dependency, so I guess there is no problem with that.
> >>>
> >>> Please add a note about this to the commit message.
> >>>
> >>
> >> Okay.
> > 
> > Sorry to point this out only now, and I realize that it might be
> > unimportant for production builds, but it is important to me, and
> > developers in general, to be able to test a single QEMU tree against a
> > number of Xen trees (all releases from 4.3 onward).
> > 
> > With this change (specifically dropping the 4.9 build test), out of tree
> > builds don't work anymore. I would like to be able to do:
> > 
> > ./configure --enable-xen --target-list=i386-softmmu \
> >                 --extra-cflags="-I$DIR/tools/include \
> >                 -I$DIR/tools/libs/toollog/include \
> >                 -I$DIR/tools/libs/evtchn/include \
> >                 -I$DIR/tools/libs/gnttab/include \
> >                 -I$DIR/tools/libs/foreignmemory/include \
> >                 -I$DIR/tools/libs/devicemodel/include \
> >                 -I$DIR/tools/libxc/include \
> >                 -I$DIR/tools/xenstore/include \
> >                 -I$DIR/tools/xenstore/compat/include" \
> >                 --extra-ldflags="-L$DIR/tools/libxc \
> >                 -L$DIR/tools/xenstore \
> >                 -L$DIR/tools/libs/evtchn \
> >                 -L$DIR/tools/libs/gnttab \
> >                 -L$DIR/tools/libs/foreignmemory \
> >                 -L$DIR/tools/libs/devicemodel \
> >                 -Wl,-rpath-link=$DIR/tools/libs/toollog \
> >                 -Wl,-rpath-link=$DIR/tools/libs/evtchn \
> >                 -Wl,-rpath-link=$DIR/tools/libs/gnttab \
> >                 -Wl,-rpath-link=$DIR/tools/libs/call \
> >                 -Wl,-rpath-link=$DIR/tools/libs/foreignmemory \
> >                 -Wl,-rpath-link=$DIR/tools/libs/devicemodel" \
> >             --disable-kvm 
> > make
> > 
> > And the make should succeed. Is there a way to do that with pkg-config?
> 
> Sure, for Xen 4.9 just do:
> 
> PKG_CONFIG_PATH=$(DIR)/tools/pkg-config ./configure \
> 		--enable-xen --target-list=i386-softmmu \
> 		--disable-kvm
> make

Yes, that works, thanks! I committed it to my next branch adding
"pkg-config, which is already a build dependency of QEMU, will be used
exclusively to determine the Xen version from Xen 4.9 onward." to the
commit message.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version
  2017-03-22 18:21                 ` Stefano Stabellini
@ 2017-03-24 15:12                   ` Paul Durrant
  -1 siblings, 0 replies; 40+ messages in thread
From: Paul Durrant @ 2017-03-24 15:12 UTC (permalink / raw)
  To: 'Stefano Stabellini', Juergen Gross
  Cc: qemu-devel, xen-devel, Anthony Perard, kraxel

> -----Original Message-----
> From: Stefano Stabellini [mailto:sstabellini@kernel.org]
> Sent: 22 March 2017 18:22
> To: Juergen Gross <jgross@suse.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>; qemu-devel@nongnu.org;
> xen-devel@lists.xenproject.org; Anthony Perard
> <anthony.perard@citrix.com>; kraxel@redhat.com; Paul Durrant
> <Paul.Durrant@citrix.com>
> Subject: Re: [PATCH 2/2] configure: use pkg-config for obtaining xen version
> 
> On Wed, 22 Mar 2017, Juergen Gross wrote:
> > On 21/03/17 19:54, Stefano Stabellini wrote:
> > > On Tue, 21 Mar 2017, Juergen Gross wrote:
> > >> On 17/03/17 19:33, Stefano Stabellini wrote:
> > >>> On Fri, 17 Mar 2017, Juergen Gross wrote:
> > >>>> On 16/03/17 21:20, Stefano Stabellini wrote:
> > >>>>> On Thu, 16 Mar 2017, Juergen Gross wrote:
> > >>>>>> Instead of trying to guess the Xen version to use by compiling
> various
> > >>>>>> test programs first just ask the system via pkg-config. Only if it
> > >>>>>> can't return the version fall back to the test program scheme.
> > >>>>>
> > >>>>> That's OK, but why did you remove the Xen unstable test?
> > >>>>
> > >>>> >From Xen 4.9 on pkg-config will return the needed information.
> There is
> > >>>> no longer a need for a test program to determine the Xen version.
> After
> > >>>> all this was the main objective of my series adding the pkg-config
> > >>>> files to Xen.
> > >>>
> > >>> I was going to say something like "yeah, but is pkg-config always
> > >>> available?" In reality, QEMU already has pkg-config as build
> > >>> dependency, so I guess there is no problem with that.
> > >>>
> > >>> Please add a note about this to the commit message.
> > >>>
> > >>
> > >> Okay.
> > >
> > > Sorry to point this out only now, and I realize that it might be
> > > unimportant for production builds, but it is important to me, and
> > > developers in general, to be able to test a single QEMU tree against a
> > > number of Xen trees (all releases from 4.3 onward).
> > >
> > > With this change (specifically dropping the 4.9 build test), out of tree
> > > builds don't work anymore. I would like to be able to do:
> > >
> > > ./configure --enable-xen --target-list=i386-softmmu \
> > >                 --extra-cflags="-I$DIR/tools/include \
> > >                 -I$DIR/tools/libs/toollog/include \
> > >                 -I$DIR/tools/libs/evtchn/include \
> > >                 -I$DIR/tools/libs/gnttab/include \
> > >                 -I$DIR/tools/libs/foreignmemory/include \
> > >                 -I$DIR/tools/libs/devicemodel/include \
> > >                 -I$DIR/tools/libxc/include \
> > >                 -I$DIR/tools/xenstore/include \
> > >                 -I$DIR/tools/xenstore/compat/include" \
> > >                 --extra-ldflags="-L$DIR/tools/libxc \
> > >                 -L$DIR/tools/xenstore \
> > >                 -L$DIR/tools/libs/evtchn \
> > >                 -L$DIR/tools/libs/gnttab \
> > >                 -L$DIR/tools/libs/foreignmemory \
> > >                 -L$DIR/tools/libs/devicemodel \
> > >                 -Wl,-rpath-link=$DIR/tools/libs/toollog \
> > >                 -Wl,-rpath-link=$DIR/tools/libs/evtchn \
> > >                 -Wl,-rpath-link=$DIR/tools/libs/gnttab \
> > >                 -Wl,-rpath-link=$DIR/tools/libs/call \
> > >                 -Wl,-rpath-link=$DIR/tools/libs/foreignmemory \
> > >                 -Wl,-rpath-link=$DIR/tools/libs/devicemodel" \
> > >             --disable-kvm
> > > make
> > >
> > > And the make should succeed. Is there a way to do that with pkg-config?
> >
> > Sure, for Xen 4.9 just do:
> >
> > PKG_CONFIG_PATH=$(DIR)/tools/pkg-config ./configure \
> > 		--enable-xen --target-list=i386-softmmu \
> > 		--disable-kvm
> > make
> 
> Yes, that works, thanks! I committed it to my next branch adding
> "pkg-config, which is already a build dependency of QEMU, will be used
> exclusively to determine the Xen version from Xen 4.9 onward." to the
> commit message.

A further question...

I have a xen tree which I've been using to build and install master against my own checked out QEMU repo. No problem with that. I've now reverted my tree to 4.7.0 and cannot build tools (even after a make distclean) because QEMU's configure is still getting up a xen_ctrl_version of 40900. This is because pkg-config is still finding a 4.9.0 xencontrol package? Where is it getting this from?

  Paul

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 2/2] configure: use pkg-config for obtaining xen version
@ 2017-03-24 15:12                   ` Paul Durrant
  0 siblings, 0 replies; 40+ messages in thread
From: Paul Durrant @ 2017-03-24 15:12 UTC (permalink / raw)
  To: 'Stefano Stabellini', Juergen Gross
  Cc: Anthony Perard, xen-devel, qemu-devel, kraxel

> -----Original Message-----
> From: Stefano Stabellini [mailto:sstabellini@kernel.org]
> Sent: 22 March 2017 18:22
> To: Juergen Gross <jgross@suse.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>; qemu-devel@nongnu.org;
> xen-devel@lists.xenproject.org; Anthony Perard
> <anthony.perard@citrix.com>; kraxel@redhat.com; Paul Durrant
> <Paul.Durrant@citrix.com>
> Subject: Re: [PATCH 2/2] configure: use pkg-config for obtaining xen version
> 
> On Wed, 22 Mar 2017, Juergen Gross wrote:
> > On 21/03/17 19:54, Stefano Stabellini wrote:
> > > On Tue, 21 Mar 2017, Juergen Gross wrote:
> > >> On 17/03/17 19:33, Stefano Stabellini wrote:
> > >>> On Fri, 17 Mar 2017, Juergen Gross wrote:
> > >>>> On 16/03/17 21:20, Stefano Stabellini wrote:
> > >>>>> On Thu, 16 Mar 2017, Juergen Gross wrote:
> > >>>>>> Instead of trying to guess the Xen version to use by compiling
> various
> > >>>>>> test programs first just ask the system via pkg-config. Only if it
> > >>>>>> can't return the version fall back to the test program scheme.
> > >>>>>
> > >>>>> That's OK, but why did you remove the Xen unstable test?
> > >>>>
> > >>>> >From Xen 4.9 on pkg-config will return the needed information.
> There is
> > >>>> no longer a need for a test program to determine the Xen version.
> After
> > >>>> all this was the main objective of my series adding the pkg-config
> > >>>> files to Xen.
> > >>>
> > >>> I was going to say something like "yeah, but is pkg-config always
> > >>> available?" In reality, QEMU already has pkg-config as build
> > >>> dependency, so I guess there is no problem with that.
> > >>>
> > >>> Please add a note about this to the commit message.
> > >>>
> > >>
> > >> Okay.
> > >
> > > Sorry to point this out only now, and I realize that it might be
> > > unimportant for production builds, but it is important to me, and
> > > developers in general, to be able to test a single QEMU tree against a
> > > number of Xen trees (all releases from 4.3 onward).
> > >
> > > With this change (specifically dropping the 4.9 build test), out of tree
> > > builds don't work anymore. I would like to be able to do:
> > >
> > > ./configure --enable-xen --target-list=i386-softmmu \
> > >                 --extra-cflags="-I$DIR/tools/include \
> > >                 -I$DIR/tools/libs/toollog/include \
> > >                 -I$DIR/tools/libs/evtchn/include \
> > >                 -I$DIR/tools/libs/gnttab/include \
> > >                 -I$DIR/tools/libs/foreignmemory/include \
> > >                 -I$DIR/tools/libs/devicemodel/include \
> > >                 -I$DIR/tools/libxc/include \
> > >                 -I$DIR/tools/xenstore/include \
> > >                 -I$DIR/tools/xenstore/compat/include" \
> > >                 --extra-ldflags="-L$DIR/tools/libxc \
> > >                 -L$DIR/tools/xenstore \
> > >                 -L$DIR/tools/libs/evtchn \
> > >                 -L$DIR/tools/libs/gnttab \
> > >                 -L$DIR/tools/libs/foreignmemory \
> > >                 -L$DIR/tools/libs/devicemodel \
> > >                 -Wl,-rpath-link=$DIR/tools/libs/toollog \
> > >                 -Wl,-rpath-link=$DIR/tools/libs/evtchn \
> > >                 -Wl,-rpath-link=$DIR/tools/libs/gnttab \
> > >                 -Wl,-rpath-link=$DIR/tools/libs/call \
> > >                 -Wl,-rpath-link=$DIR/tools/libs/foreignmemory \
> > >                 -Wl,-rpath-link=$DIR/tools/libs/devicemodel" \
> > >             --disable-kvm
> > > make
> > >
> > > And the make should succeed. Is there a way to do that with pkg-config?
> >
> > Sure, for Xen 4.9 just do:
> >
> > PKG_CONFIG_PATH=$(DIR)/tools/pkg-config ./configure \
> > 		--enable-xen --target-list=i386-softmmu \
> > 		--disable-kvm
> > make
> 
> Yes, that works, thanks! I committed it to my next branch adding
> "pkg-config, which is already a build dependency of QEMU, will be used
> exclusively to determine the Xen version from Xen 4.9 onward." to the
> commit message.

A further question...

I have a xen tree which I've been using to build and install master against my own checked out QEMU repo. No problem with that. I've now reverted my tree to 4.7.0 and cannot build tools (even after a make distclean) because QEMU's configure is still getting up a xen_ctrl_version of 40900. This is because pkg-config is still finding a 4.9.0 xencontrol package? Where is it getting this from?

  Paul


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version
  2017-03-24 15:12                   ` Paul Durrant
@ 2017-03-24 15:24                     ` Paul Durrant
  -1 siblings, 0 replies; 40+ messages in thread
From: Paul Durrant @ 2017-03-24 15:24 UTC (permalink / raw)
  To: 'Stefano Stabellini', 'Juergen Gross'
  Cc: 'qemu-devel@nongnu.org',
	'xen-devel@lists.xenproject.org',
	Anthony Perard, 'kraxel@redhat.com'

> -----Original Message-----
> From: Paul Durrant
> Sent: 24 March 2017 15:13
> To: 'Stefano Stabellini' <sstabellini@kernel.org>; Juergen Gross
> <jgross@suse.com>
> Cc: qemu-devel@nongnu.org; xen-devel@lists.xenproject.org; Anthony
> Perard <anthony.perard@citrix.com>; kraxel@redhat.com
> Subject: RE: [PATCH 2/2] configure: use pkg-config for obtaining xen version
> 
> > -----Original Message-----
> > From: Stefano Stabellini [mailto:sstabellini@kernel.org]
> > Sent: 22 March 2017 18:22
> > To: Juergen Gross <jgross@suse.com>
> > Cc: Stefano Stabellini <sstabellini@kernel.org>; qemu-devel@nongnu.org;
> > xen-devel@lists.xenproject.org; Anthony Perard
> > <anthony.perard@citrix.com>; kraxel@redhat.com; Paul Durrant
> > <Paul.Durrant@citrix.com>
> > Subject: Re: [PATCH 2/2] configure: use pkg-config for obtaining xen
> version
> >
> > On Wed, 22 Mar 2017, Juergen Gross wrote:
> > > On 21/03/17 19:54, Stefano Stabellini wrote:
> > > > On Tue, 21 Mar 2017, Juergen Gross wrote:
> > > >> On 17/03/17 19:33, Stefano Stabellini wrote:
> > > >>> On Fri, 17 Mar 2017, Juergen Gross wrote:
> > > >>>> On 16/03/17 21:20, Stefano Stabellini wrote:
> > > >>>>> On Thu, 16 Mar 2017, Juergen Gross wrote:
> > > >>>>>> Instead of trying to guess the Xen version to use by compiling
> > various
> > > >>>>>> test programs first just ask the system via pkg-config. Only if it
> > > >>>>>> can't return the version fall back to the test program scheme.
> > > >>>>>
> > > >>>>> That's OK, but why did you remove the Xen unstable test?
> > > >>>>
> > > >>>> >From Xen 4.9 on pkg-config will return the needed information.
> > There is
> > > >>>> no longer a need for a test program to determine the Xen version.
> > After
> > > >>>> all this was the main objective of my series adding the pkg-config
> > > >>>> files to Xen.
> > > >>>
> > > >>> I was going to say something like "yeah, but is pkg-config always
> > > >>> available?" In reality, QEMU already has pkg-config as build
> > > >>> dependency, so I guess there is no problem with that.
> > > >>>
> > > >>> Please add a note about this to the commit message.
> > > >>>
> > > >>
> > > >> Okay.
> > > >
> > > > Sorry to point this out only now, and I realize that it might be
> > > > unimportant for production builds, but it is important to me, and
> > > > developers in general, to be able to test a single QEMU tree against a
> > > > number of Xen trees (all releases from 4.3 onward).
> > > >
> > > > With this change (specifically dropping the 4.9 build test), out of tree
> > > > builds don't work anymore. I would like to be able to do:
> > > >
> > > > ./configure --enable-xen --target-list=i386-softmmu \
> > > >                 --extra-cflags="-I$DIR/tools/include \
> > > >                 -I$DIR/tools/libs/toollog/include \
> > > >                 -I$DIR/tools/libs/evtchn/include \
> > > >                 -I$DIR/tools/libs/gnttab/include \
> > > >                 -I$DIR/tools/libs/foreignmemory/include \
> > > >                 -I$DIR/tools/libs/devicemodel/include \
> > > >                 -I$DIR/tools/libxc/include \
> > > >                 -I$DIR/tools/xenstore/include \
> > > >                 -I$DIR/tools/xenstore/compat/include" \
> > > >                 --extra-ldflags="-L$DIR/tools/libxc \
> > > >                 -L$DIR/tools/xenstore \
> > > >                 -L$DIR/tools/libs/evtchn \
> > > >                 -L$DIR/tools/libs/gnttab \
> > > >                 -L$DIR/tools/libs/foreignmemory \
> > > >                 -L$DIR/tools/libs/devicemodel \
> > > >                 -Wl,-rpath-link=$DIR/tools/libs/toollog \
> > > >                 -Wl,-rpath-link=$DIR/tools/libs/evtchn \
> > > >                 -Wl,-rpath-link=$DIR/tools/libs/gnttab \
> > > >                 -Wl,-rpath-link=$DIR/tools/libs/call \
> > > >                 -Wl,-rpath-link=$DIR/tools/libs/foreignmemory \
> > > >                 -Wl,-rpath-link=$DIR/tools/libs/devicemodel" \
> > > >             --disable-kvm
> > > > make
> > > >
> > > > And the make should succeed. Is there a way to do that with pkg-
> config?
> > >
> > > Sure, for Xen 4.9 just do:
> > >
> > > PKG_CONFIG_PATH=$(DIR)/tools/pkg-config ./configure \
> > > 		--enable-xen --target-list=i386-softmmu \
> > > 		--disable-kvm
> > > make
> >
> > Yes, that works, thanks! I committed it to my next branch adding
> > "pkg-config, which is already a build dependency of QEMU, will be used
> > exclusively to determine the Xen version from Xen 4.9 onward." to the
> > commit message.
> 
> A further question...
> 
> I have a xen tree which I've been using to build and install master against my
> own checked out QEMU repo. No problem with that. I've now reverted my
> tree to 4.7.0 and cannot build tools (even after a make distclean) because
> QEMU's configure is still getting up a xen_ctrl_version of 40900. This is
> because pkg-config is still finding a 4.9.0 xencontrol package? Where is it
> getting this from?
> 

Even in a completely fresh checkout of xen.git RELEASE-4.7.2 tag I'm *still* getting a xen_ctrl_version of 40900, which presumably means it is coming from the version of xenctrl I have *installed* rather than the one I've built. This is quite a change in behaviour and one that is going to cause problems.

  Paul

>   Paul

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 2/2] configure: use pkg-config for obtaining xen version
@ 2017-03-24 15:24                     ` Paul Durrant
  0 siblings, 0 replies; 40+ messages in thread
From: Paul Durrant @ 2017-03-24 15:24 UTC (permalink / raw)
  To: 'Stefano Stabellini', 'Juergen Gross'
  Cc: Anthony Perard, 'xen-devel@lists.xenproject.org',
	'qemu-devel@nongnu.org', 'kraxel@redhat.com'

> -----Original Message-----
> From: Paul Durrant
> Sent: 24 March 2017 15:13
> To: 'Stefano Stabellini' <sstabellini@kernel.org>; Juergen Gross
> <jgross@suse.com>
> Cc: qemu-devel@nongnu.org; xen-devel@lists.xenproject.org; Anthony
> Perard <anthony.perard@citrix.com>; kraxel@redhat.com
> Subject: RE: [PATCH 2/2] configure: use pkg-config for obtaining xen version
> 
> > -----Original Message-----
> > From: Stefano Stabellini [mailto:sstabellini@kernel.org]
> > Sent: 22 March 2017 18:22
> > To: Juergen Gross <jgross@suse.com>
> > Cc: Stefano Stabellini <sstabellini@kernel.org>; qemu-devel@nongnu.org;
> > xen-devel@lists.xenproject.org; Anthony Perard
> > <anthony.perard@citrix.com>; kraxel@redhat.com; Paul Durrant
> > <Paul.Durrant@citrix.com>
> > Subject: Re: [PATCH 2/2] configure: use pkg-config for obtaining xen
> version
> >
> > On Wed, 22 Mar 2017, Juergen Gross wrote:
> > > On 21/03/17 19:54, Stefano Stabellini wrote:
> > > > On Tue, 21 Mar 2017, Juergen Gross wrote:
> > > >> On 17/03/17 19:33, Stefano Stabellini wrote:
> > > >>> On Fri, 17 Mar 2017, Juergen Gross wrote:
> > > >>>> On 16/03/17 21:20, Stefano Stabellini wrote:
> > > >>>>> On Thu, 16 Mar 2017, Juergen Gross wrote:
> > > >>>>>> Instead of trying to guess the Xen version to use by compiling
> > various
> > > >>>>>> test programs first just ask the system via pkg-config. Only if it
> > > >>>>>> can't return the version fall back to the test program scheme.
> > > >>>>>
> > > >>>>> That's OK, but why did you remove the Xen unstable test?
> > > >>>>
> > > >>>> >From Xen 4.9 on pkg-config will return the needed information.
> > There is
> > > >>>> no longer a need for a test program to determine the Xen version.
> > After
> > > >>>> all this was the main objective of my series adding the pkg-config
> > > >>>> files to Xen.
> > > >>>
> > > >>> I was going to say something like "yeah, but is pkg-config always
> > > >>> available?" In reality, QEMU already has pkg-config as build
> > > >>> dependency, so I guess there is no problem with that.
> > > >>>
> > > >>> Please add a note about this to the commit message.
> > > >>>
> > > >>
> > > >> Okay.
> > > >
> > > > Sorry to point this out only now, and I realize that it might be
> > > > unimportant for production builds, but it is important to me, and
> > > > developers in general, to be able to test a single QEMU tree against a
> > > > number of Xen trees (all releases from 4.3 onward).
> > > >
> > > > With this change (specifically dropping the 4.9 build test), out of tree
> > > > builds don't work anymore. I would like to be able to do:
> > > >
> > > > ./configure --enable-xen --target-list=i386-softmmu \
> > > >                 --extra-cflags="-I$DIR/tools/include \
> > > >                 -I$DIR/tools/libs/toollog/include \
> > > >                 -I$DIR/tools/libs/evtchn/include \
> > > >                 -I$DIR/tools/libs/gnttab/include \
> > > >                 -I$DIR/tools/libs/foreignmemory/include \
> > > >                 -I$DIR/tools/libs/devicemodel/include \
> > > >                 -I$DIR/tools/libxc/include \
> > > >                 -I$DIR/tools/xenstore/include \
> > > >                 -I$DIR/tools/xenstore/compat/include" \
> > > >                 --extra-ldflags="-L$DIR/tools/libxc \
> > > >                 -L$DIR/tools/xenstore \
> > > >                 -L$DIR/tools/libs/evtchn \
> > > >                 -L$DIR/tools/libs/gnttab \
> > > >                 -L$DIR/tools/libs/foreignmemory \
> > > >                 -L$DIR/tools/libs/devicemodel \
> > > >                 -Wl,-rpath-link=$DIR/tools/libs/toollog \
> > > >                 -Wl,-rpath-link=$DIR/tools/libs/evtchn \
> > > >                 -Wl,-rpath-link=$DIR/tools/libs/gnttab \
> > > >                 -Wl,-rpath-link=$DIR/tools/libs/call \
> > > >                 -Wl,-rpath-link=$DIR/tools/libs/foreignmemory \
> > > >                 -Wl,-rpath-link=$DIR/tools/libs/devicemodel" \
> > > >             --disable-kvm
> > > > make
> > > >
> > > > And the make should succeed. Is there a way to do that with pkg-
> config?
> > >
> > > Sure, for Xen 4.9 just do:
> > >
> > > PKG_CONFIG_PATH=$(DIR)/tools/pkg-config ./configure \
> > > 		--enable-xen --target-list=i386-softmmu \
> > > 		--disable-kvm
> > > make
> >
> > Yes, that works, thanks! I committed it to my next branch adding
> > "pkg-config, which is already a build dependency of QEMU, will be used
> > exclusively to determine the Xen version from Xen 4.9 onward." to the
> > commit message.
> 
> A further question...
> 
> I have a xen tree which I've been using to build and install master against my
> own checked out QEMU repo. No problem with that. I've now reverted my
> tree to 4.7.0 and cannot build tools (even after a make distclean) because
> QEMU's configure is still getting up a xen_ctrl_version of 40900. This is
> because pkg-config is still finding a 4.9.0 xencontrol package? Where is it
> getting this from?
> 

Even in a completely fresh checkout of xen.git RELEASE-4.7.2 tag I'm *still* getting a xen_ctrl_version of 40900, which presumably means it is coming from the version of xenctrl I have *installed* rather than the one I've built. This is quite a change in behaviour and one that is going to cause problems.

  Paul

>   Paul


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [Xen-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version
  2017-03-24 15:12                   ` Paul Durrant
@ 2017-03-24 15:34                     ` Juergen Gross
  -1 siblings, 0 replies; 40+ messages in thread
From: Juergen Gross @ 2017-03-24 15:34 UTC (permalink / raw)
  To: Paul Durrant, 'Stefano Stabellini'
  Cc: Anthony Perard, xen-devel, qemu-devel, kraxel

On 24/03/17 16:12, Paul Durrant wrote:
>> -----Original Message-----
>> From: Stefano Stabellini [mailto:sstabellini@kernel.org]
>> Sent: 22 March 2017 18:22
>> To: Juergen Gross <jgross@suse.com>
>> Cc: Stefano Stabellini <sstabellini@kernel.org>; qemu-devel@nongnu.org;
>> xen-devel@lists.xenproject.org; Anthony Perard
>> <anthony.perard@citrix.com>; kraxel@redhat.com; Paul Durrant
>> <Paul.Durrant@citrix.com>
>> Subject: Re: [PATCH 2/2] configure: use pkg-config for obtaining xen version
>>
>> On Wed, 22 Mar 2017, Juergen Gross wrote:
>>> On 21/03/17 19:54, Stefano Stabellini wrote:
>>>> On Tue, 21 Mar 2017, Juergen Gross wrote:
>>>>> On 17/03/17 19:33, Stefano Stabellini wrote:
>>>>>> On Fri, 17 Mar 2017, Juergen Gross wrote:
>>>>>>> On 16/03/17 21:20, Stefano Stabellini wrote:
>>>>>>>> On Thu, 16 Mar 2017, Juergen Gross wrote:
>>>>>>>>> Instead of trying to guess the Xen version to use by compiling
>> various
>>>>>>>>> test programs first just ask the system via pkg-config. Only if it
>>>>>>>>> can't return the version fall back to the test program scheme.
>>>>>>>>
>>>>>>>> That's OK, but why did you remove the Xen unstable test?
>>>>>>>
>>>>>>> >From Xen 4.9 on pkg-config will return the needed information.
>> There is
>>>>>>> no longer a need for a test program to determine the Xen version.
>> After
>>>>>>> all this was the main objective of my series adding the pkg-config
>>>>>>> files to Xen.
>>>>>>
>>>>>> I was going to say something like "yeah, but is pkg-config always
>>>>>> available?" In reality, QEMU already has pkg-config as build
>>>>>> dependency, so I guess there is no problem with that.
>>>>>>
>>>>>> Please add a note about this to the commit message.
>>>>>>
>>>>>
>>>>> Okay.
>>>>
>>>> Sorry to point this out only now, and I realize that it might be
>>>> unimportant for production builds, but it is important to me, and
>>>> developers in general, to be able to test a single QEMU tree against a
>>>> number of Xen trees (all releases from 4.3 onward).
>>>>
>>>> With this change (specifically dropping the 4.9 build test), out of tree
>>>> builds don't work anymore. I would like to be able to do:
>>>>
>>>> ./configure --enable-xen --target-list=i386-softmmu \
>>>>                 --extra-cflags="-I$DIR/tools/include \
>>>>                 -I$DIR/tools/libs/toollog/include \
>>>>                 -I$DIR/tools/libs/evtchn/include \
>>>>                 -I$DIR/tools/libs/gnttab/include \
>>>>                 -I$DIR/tools/libs/foreignmemory/include \
>>>>                 -I$DIR/tools/libs/devicemodel/include \
>>>>                 -I$DIR/tools/libxc/include \
>>>>                 -I$DIR/tools/xenstore/include \
>>>>                 -I$DIR/tools/xenstore/compat/include" \
>>>>                 --extra-ldflags="-L$DIR/tools/libxc \
>>>>                 -L$DIR/tools/xenstore \
>>>>                 -L$DIR/tools/libs/evtchn \
>>>>                 -L$DIR/tools/libs/gnttab \
>>>>                 -L$DIR/tools/libs/foreignmemory \
>>>>                 -L$DIR/tools/libs/devicemodel \
>>>>                 -Wl,-rpath-link=$DIR/tools/libs/toollog \
>>>>                 -Wl,-rpath-link=$DIR/tools/libs/evtchn \
>>>>                 -Wl,-rpath-link=$DIR/tools/libs/gnttab \
>>>>                 -Wl,-rpath-link=$DIR/tools/libs/call \
>>>>                 -Wl,-rpath-link=$DIR/tools/libs/foreignmemory \
>>>>                 -Wl,-rpath-link=$DIR/tools/libs/devicemodel" \
>>>>             --disable-kvm
>>>> make
>>>>
>>>> And the make should succeed. Is there a way to do that with pkg-config?
>>>
>>> Sure, for Xen 4.9 just do:
>>>
>>> PKG_CONFIG_PATH=$(DIR)/tools/pkg-config ./configure \
>>> 		--enable-xen --target-list=i386-softmmu \
>>> 		--disable-kvm
>>> make
>>
>> Yes, that works, thanks! I committed it to my next branch adding
>> "pkg-config, which is already a build dependency of QEMU, will be used
>> exclusively to determine the Xen version from Xen 4.9 onward." to the
>> commit message.
> 
> A further question...
> 
> I have a xen tree which I've been using to build and install master against my own checked out QEMU repo. No problem with that. I've now reverted my tree to 4.7.0 and cannot build tools (even after a make distclean) because QEMU's configure is still getting up a xen_ctrl_version of 40900. This is because pkg-config is still finding a 4.9.0 xencontrol package? Where is it getting this from?

Hmm, could it be you have Xen unstable installed on your machine?

Didn't think of this problem. I can think of 3 solutions:

a) delete the xencontrol.pc file (on my system under
   /usr/share/pkgconfig/ )

b) we add a patch to qemu to test an environment variable whether
   pkg-config should be ignored for Xen version detection

c) set the environment variable PKG_CONFIG_LIBDIR to a local directory
   and copy all but the xen*.pc files from /usr/share/pkgconfig/ (or
   your correct directory) to it (or link them to avoid missing updates)

OTOH this is something you have to be aware of for other packages as
well: mixing the build environment and the target environment can lead
to bad results. Now Xen has been added to the list.


Juergen

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 2/2] configure: use pkg-config for obtaining xen version
@ 2017-03-24 15:34                     ` Juergen Gross
  0 siblings, 0 replies; 40+ messages in thread
From: Juergen Gross @ 2017-03-24 15:34 UTC (permalink / raw)
  To: Paul Durrant, 'Stefano Stabellini'
  Cc: Anthony Perard, xen-devel, qemu-devel, kraxel

On 24/03/17 16:12, Paul Durrant wrote:
>> -----Original Message-----
>> From: Stefano Stabellini [mailto:sstabellini@kernel.org]
>> Sent: 22 March 2017 18:22
>> To: Juergen Gross <jgross@suse.com>
>> Cc: Stefano Stabellini <sstabellini@kernel.org>; qemu-devel@nongnu.org;
>> xen-devel@lists.xenproject.org; Anthony Perard
>> <anthony.perard@citrix.com>; kraxel@redhat.com; Paul Durrant
>> <Paul.Durrant@citrix.com>
>> Subject: Re: [PATCH 2/2] configure: use pkg-config for obtaining xen version
>>
>> On Wed, 22 Mar 2017, Juergen Gross wrote:
>>> On 21/03/17 19:54, Stefano Stabellini wrote:
>>>> On Tue, 21 Mar 2017, Juergen Gross wrote:
>>>>> On 17/03/17 19:33, Stefano Stabellini wrote:
>>>>>> On Fri, 17 Mar 2017, Juergen Gross wrote:
>>>>>>> On 16/03/17 21:20, Stefano Stabellini wrote:
>>>>>>>> On Thu, 16 Mar 2017, Juergen Gross wrote:
>>>>>>>>> Instead of trying to guess the Xen version to use by compiling
>> various
>>>>>>>>> test programs first just ask the system via pkg-config. Only if it
>>>>>>>>> can't return the version fall back to the test program scheme.
>>>>>>>>
>>>>>>>> That's OK, but why did you remove the Xen unstable test?
>>>>>>>
>>>>>>> >From Xen 4.9 on pkg-config will return the needed information.
>> There is
>>>>>>> no longer a need for a test program to determine the Xen version.
>> After
>>>>>>> all this was the main objective of my series adding the pkg-config
>>>>>>> files to Xen.
>>>>>>
>>>>>> I was going to say something like "yeah, but is pkg-config always
>>>>>> available?" In reality, QEMU already has pkg-config as build
>>>>>> dependency, so I guess there is no problem with that.
>>>>>>
>>>>>> Please add a note about this to the commit message.
>>>>>>
>>>>>
>>>>> Okay.
>>>>
>>>> Sorry to point this out only now, and I realize that it might be
>>>> unimportant for production builds, but it is important to me, and
>>>> developers in general, to be able to test a single QEMU tree against a
>>>> number of Xen trees (all releases from 4.3 onward).
>>>>
>>>> With this change (specifically dropping the 4.9 build test), out of tree
>>>> builds don't work anymore. I would like to be able to do:
>>>>
>>>> ./configure --enable-xen --target-list=i386-softmmu \
>>>>                 --extra-cflags="-I$DIR/tools/include \
>>>>                 -I$DIR/tools/libs/toollog/include \
>>>>                 -I$DIR/tools/libs/evtchn/include \
>>>>                 -I$DIR/tools/libs/gnttab/include \
>>>>                 -I$DIR/tools/libs/foreignmemory/include \
>>>>                 -I$DIR/tools/libs/devicemodel/include \
>>>>                 -I$DIR/tools/libxc/include \
>>>>                 -I$DIR/tools/xenstore/include \
>>>>                 -I$DIR/tools/xenstore/compat/include" \
>>>>                 --extra-ldflags="-L$DIR/tools/libxc \
>>>>                 -L$DIR/tools/xenstore \
>>>>                 -L$DIR/tools/libs/evtchn \
>>>>                 -L$DIR/tools/libs/gnttab \
>>>>                 -L$DIR/tools/libs/foreignmemory \
>>>>                 -L$DIR/tools/libs/devicemodel \
>>>>                 -Wl,-rpath-link=$DIR/tools/libs/toollog \
>>>>                 -Wl,-rpath-link=$DIR/tools/libs/evtchn \
>>>>                 -Wl,-rpath-link=$DIR/tools/libs/gnttab \
>>>>                 -Wl,-rpath-link=$DIR/tools/libs/call \
>>>>                 -Wl,-rpath-link=$DIR/tools/libs/foreignmemory \
>>>>                 -Wl,-rpath-link=$DIR/tools/libs/devicemodel" \
>>>>             --disable-kvm
>>>> make
>>>>
>>>> And the make should succeed. Is there a way to do that with pkg-config?
>>>
>>> Sure, for Xen 4.9 just do:
>>>
>>> PKG_CONFIG_PATH=$(DIR)/tools/pkg-config ./configure \
>>> 		--enable-xen --target-list=i386-softmmu \
>>> 		--disable-kvm
>>> make
>>
>> Yes, that works, thanks! I committed it to my next branch adding
>> "pkg-config, which is already a build dependency of QEMU, will be used
>> exclusively to determine the Xen version from Xen 4.9 onward." to the
>> commit message.
> 
> A further question...
> 
> I have a xen tree which I've been using to build and install master against my own checked out QEMU repo. No problem with that. I've now reverted my tree to 4.7.0 and cannot build tools (even after a make distclean) because QEMU's configure is still getting up a xen_ctrl_version of 40900. This is because pkg-config is still finding a 4.9.0 xencontrol package? Where is it getting this from?

Hmm, could it be you have Xen unstable installed on your machine?

Didn't think of this problem. I can think of 3 solutions:

a) delete the xencontrol.pc file (on my system under
   /usr/share/pkgconfig/ )

b) we add a patch to qemu to test an environment variable whether
   pkg-config should be ignored for Xen version detection

c) set the environment variable PKG_CONFIG_LIBDIR to a local directory
   and copy all but the xen*.pc files from /usr/share/pkgconfig/ (or
   your correct directory) to it (or link them to avoid missing updates)

OTOH this is something you have to be aware of for other packages as
well: mixing the build environment and the target environment can lead
to bad results. Now Xen has been added to the list.


Juergen


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [Xen-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version
  2017-03-24 15:34                     ` Juergen Gross
@ 2017-03-24 15:44                       ` Paul Durrant
  -1 siblings, 0 replies; 40+ messages in thread
From: Paul Durrant @ 2017-03-24 15:44 UTC (permalink / raw)
  To: 'Juergen Gross', 'Stefano Stabellini'
  Cc: Anthony Perard, xen-devel, qemu-devel, kraxel

> -----Original Message-----
> From: Juergen Gross [mailto:jgross@suse.com]
> Sent: 24 March 2017 15:35
> To: Paul Durrant <Paul.Durrant@citrix.com>; 'Stefano Stabellini'
> <sstabellini@kernel.org>
> Cc: Anthony Perard <anthony.perard@citrix.com>; xen-
> devel@lists.xenproject.org; qemu-devel@nongnu.org; kraxel@redhat.com
> Subject: Re: [Xen-devel] [PATCH 2/2] configure: use pkg-config for obtaining
> xen version
> 
> On 24/03/17 16:12, Paul Durrant wrote:
> >> -----Original Message-----
> >> From: Stefano Stabellini [mailto:sstabellini@kernel.org]
> >> Sent: 22 March 2017 18:22
> >> To: Juergen Gross <jgross@suse.com>
> >> Cc: Stefano Stabellini <sstabellini@kernel.org>; qemu-
> devel@nongnu.org;
> >> xen-devel@lists.xenproject.org; Anthony Perard
> >> <anthony.perard@citrix.com>; kraxel@redhat.com; Paul Durrant
> >> <Paul.Durrant@citrix.com>
> >> Subject: Re: [PATCH 2/2] configure: use pkg-config for obtaining xen
> version
> >>
> >> On Wed, 22 Mar 2017, Juergen Gross wrote:
> >>> On 21/03/17 19:54, Stefano Stabellini wrote:
> >>>> On Tue, 21 Mar 2017, Juergen Gross wrote:
> >>>>> On 17/03/17 19:33, Stefano Stabellini wrote:
> >>>>>> On Fri, 17 Mar 2017, Juergen Gross wrote:
> >>>>>>> On 16/03/17 21:20, Stefano Stabellini wrote:
> >>>>>>>> On Thu, 16 Mar 2017, Juergen Gross wrote:
> >>>>>>>>> Instead of trying to guess the Xen version to use by compiling
> >> various
> >>>>>>>>> test programs first just ask the system via pkg-config. Only if it
> >>>>>>>>> can't return the version fall back to the test program scheme.
> >>>>>>>>
> >>>>>>>> That's OK, but why did you remove the Xen unstable test?
> >>>>>>>
> >>>>>>> >From Xen 4.9 on pkg-config will return the needed information.
> >> There is
> >>>>>>> no longer a need for a test program to determine the Xen version.
> >> After
> >>>>>>> all this was the main objective of my series adding the pkg-config
> >>>>>>> files to Xen.
> >>>>>>
> >>>>>> I was going to say something like "yeah, but is pkg-config always
> >>>>>> available?" In reality, QEMU already has pkg-config as build
> >>>>>> dependency, so I guess there is no problem with that.
> >>>>>>
> >>>>>> Please add a note about this to the commit message.
> >>>>>>
> >>>>>
> >>>>> Okay.
> >>>>
> >>>> Sorry to point this out only now, and I realize that it might be
> >>>> unimportant for production builds, but it is important to me, and
> >>>> developers in general, to be able to test a single QEMU tree against a
> >>>> number of Xen trees (all releases from 4.3 onward).
> >>>>
> >>>> With this change (specifically dropping the 4.9 build test), out of tree
> >>>> builds don't work anymore. I would like to be able to do:
> >>>>
> >>>> ./configure --enable-xen --target-list=i386-softmmu \
> >>>>                 --extra-cflags="-I$DIR/tools/include \
> >>>>                 -I$DIR/tools/libs/toollog/include \
> >>>>                 -I$DIR/tools/libs/evtchn/include \
> >>>>                 -I$DIR/tools/libs/gnttab/include \
> >>>>                 -I$DIR/tools/libs/foreignmemory/include \
> >>>>                 -I$DIR/tools/libs/devicemodel/include \
> >>>>                 -I$DIR/tools/libxc/include \
> >>>>                 -I$DIR/tools/xenstore/include \
> >>>>                 -I$DIR/tools/xenstore/compat/include" \
> >>>>                 --extra-ldflags="-L$DIR/tools/libxc \
> >>>>                 -L$DIR/tools/xenstore \
> >>>>                 -L$DIR/tools/libs/evtchn \
> >>>>                 -L$DIR/tools/libs/gnttab \
> >>>>                 -L$DIR/tools/libs/foreignmemory \
> >>>>                 -L$DIR/tools/libs/devicemodel \
> >>>>                 -Wl,-rpath-link=$DIR/tools/libs/toollog \
> >>>>                 -Wl,-rpath-link=$DIR/tools/libs/evtchn \
> >>>>                 -Wl,-rpath-link=$DIR/tools/libs/gnttab \
> >>>>                 -Wl,-rpath-link=$DIR/tools/libs/call \
> >>>>                 -Wl,-rpath-link=$DIR/tools/libs/foreignmemory \
> >>>>                 -Wl,-rpath-link=$DIR/tools/libs/devicemodel" \
> >>>>             --disable-kvm
> >>>> make
> >>>>
> >>>> And the make should succeed. Is there a way to do that with pkg-
> config?
> >>>
> >>> Sure, for Xen 4.9 just do:
> >>>
> >>> PKG_CONFIG_PATH=$(DIR)/tools/pkg-config ./configure \
> >>> 		--enable-xen --target-list=i386-softmmu \
> >>> 		--disable-kvm
> >>> make
> >>
> >> Yes, that works, thanks! I committed it to my next branch adding
> >> "pkg-config, which is already a build dependency of QEMU, will be used
> >> exclusively to determine the Xen version from Xen 4.9 onward." to the
> >> commit message.
> >
> > A further question...
> >
> > I have a xen tree which I've been using to build and install master against
> my own checked out QEMU repo. No problem with that. I've now reverted
> my tree to 4.7.0 and cannot build tools (even after a make distclean) because
> QEMU's configure is still getting up a xen_ctrl_version of 40900. This is
> because pkg-config is still finding a 4.9.0 xencontrol package? Where is it
> getting this from?
> 
> Hmm, could it be you have Xen unstable installed on your machine?

I do indeed. I build on my test machine.

> 
> Didn't think of this problem. I can think of 3 solutions:
> 
> a) delete the xencontrol.pc file (on my system under
>    /usr/share/pkgconfig/ )
> 

I just found mine using pkg-config --debug... /usr/local/share/pkgconfig for me

> b) we add a patch to qemu to test an environment variable whether
>    pkg-config should be ignored for Xen version detection
> 
> c) set the environment variable PKG_CONFIG_LIBDIR to a local directory
>    and copy all but the xen*.pc files from /usr/share/pkgconfig/ (or
>    your correct directory) to it (or link them to avoid missing updates)
> 
> OTOH this is something you have to be aware of for other packages as
> well: mixing the build environment and the target environment can lead
> to bad results. Now Xen has been added to the list.
> 

That's a change in behaviour that I, and probably others, have long been used to. What we really want, presumably, is to have pkg-config just look under tools/pkgconfig when querying for the version of xencontrol. Could that not be done by simply setting PKG_CONFIG_LIBDIR in QEMU's configure script, or would it still mean picking up installed libraries before ones just built?

  Paul

> 
> Juergen


^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 2/2] configure: use pkg-config for obtaining xen version
@ 2017-03-24 15:44                       ` Paul Durrant
  0 siblings, 0 replies; 40+ messages in thread
From: Paul Durrant @ 2017-03-24 15:44 UTC (permalink / raw)
  To: 'Juergen Gross', 'Stefano Stabellini'
  Cc: Anthony Perard, xen-devel, qemu-devel, kraxel

> -----Original Message-----
> From: Juergen Gross [mailto:jgross@suse.com]
> Sent: 24 March 2017 15:35
> To: Paul Durrant <Paul.Durrant@citrix.com>; 'Stefano Stabellini'
> <sstabellini@kernel.org>
> Cc: Anthony Perard <anthony.perard@citrix.com>; xen-
> devel@lists.xenproject.org; qemu-devel@nongnu.org; kraxel@redhat.com
> Subject: Re: [Xen-devel] [PATCH 2/2] configure: use pkg-config for obtaining
> xen version
> 
> On 24/03/17 16:12, Paul Durrant wrote:
> >> -----Original Message-----
> >> From: Stefano Stabellini [mailto:sstabellini@kernel.org]
> >> Sent: 22 March 2017 18:22
> >> To: Juergen Gross <jgross@suse.com>
> >> Cc: Stefano Stabellini <sstabellini@kernel.org>; qemu-
> devel@nongnu.org;
> >> xen-devel@lists.xenproject.org; Anthony Perard
> >> <anthony.perard@citrix.com>; kraxel@redhat.com; Paul Durrant
> >> <Paul.Durrant@citrix.com>
> >> Subject: Re: [PATCH 2/2] configure: use pkg-config for obtaining xen
> version
> >>
> >> On Wed, 22 Mar 2017, Juergen Gross wrote:
> >>> On 21/03/17 19:54, Stefano Stabellini wrote:
> >>>> On Tue, 21 Mar 2017, Juergen Gross wrote:
> >>>>> On 17/03/17 19:33, Stefano Stabellini wrote:
> >>>>>> On Fri, 17 Mar 2017, Juergen Gross wrote:
> >>>>>>> On 16/03/17 21:20, Stefano Stabellini wrote:
> >>>>>>>> On Thu, 16 Mar 2017, Juergen Gross wrote:
> >>>>>>>>> Instead of trying to guess the Xen version to use by compiling
> >> various
> >>>>>>>>> test programs first just ask the system via pkg-config. Only if it
> >>>>>>>>> can't return the version fall back to the test program scheme.
> >>>>>>>>
> >>>>>>>> That's OK, but why did you remove the Xen unstable test?
> >>>>>>>
> >>>>>>> >From Xen 4.9 on pkg-config will return the needed information.
> >> There is
> >>>>>>> no longer a need for a test program to determine the Xen version.
> >> After
> >>>>>>> all this was the main objective of my series adding the pkg-config
> >>>>>>> files to Xen.
> >>>>>>
> >>>>>> I was going to say something like "yeah, but is pkg-config always
> >>>>>> available?" In reality, QEMU already has pkg-config as build
> >>>>>> dependency, so I guess there is no problem with that.
> >>>>>>
> >>>>>> Please add a note about this to the commit message.
> >>>>>>
> >>>>>
> >>>>> Okay.
> >>>>
> >>>> Sorry to point this out only now, and I realize that it might be
> >>>> unimportant for production builds, but it is important to me, and
> >>>> developers in general, to be able to test a single QEMU tree against a
> >>>> number of Xen trees (all releases from 4.3 onward).
> >>>>
> >>>> With this change (specifically dropping the 4.9 build test), out of tree
> >>>> builds don't work anymore. I would like to be able to do:
> >>>>
> >>>> ./configure --enable-xen --target-list=i386-softmmu \
> >>>>                 --extra-cflags="-I$DIR/tools/include \
> >>>>                 -I$DIR/tools/libs/toollog/include \
> >>>>                 -I$DIR/tools/libs/evtchn/include \
> >>>>                 -I$DIR/tools/libs/gnttab/include \
> >>>>                 -I$DIR/tools/libs/foreignmemory/include \
> >>>>                 -I$DIR/tools/libs/devicemodel/include \
> >>>>                 -I$DIR/tools/libxc/include \
> >>>>                 -I$DIR/tools/xenstore/include \
> >>>>                 -I$DIR/tools/xenstore/compat/include" \
> >>>>                 --extra-ldflags="-L$DIR/tools/libxc \
> >>>>                 -L$DIR/tools/xenstore \
> >>>>                 -L$DIR/tools/libs/evtchn \
> >>>>                 -L$DIR/tools/libs/gnttab \
> >>>>                 -L$DIR/tools/libs/foreignmemory \
> >>>>                 -L$DIR/tools/libs/devicemodel \
> >>>>                 -Wl,-rpath-link=$DIR/tools/libs/toollog \
> >>>>                 -Wl,-rpath-link=$DIR/tools/libs/evtchn \
> >>>>                 -Wl,-rpath-link=$DIR/tools/libs/gnttab \
> >>>>                 -Wl,-rpath-link=$DIR/tools/libs/call \
> >>>>                 -Wl,-rpath-link=$DIR/tools/libs/foreignmemory \
> >>>>                 -Wl,-rpath-link=$DIR/tools/libs/devicemodel" \
> >>>>             --disable-kvm
> >>>> make
> >>>>
> >>>> And the make should succeed. Is there a way to do that with pkg-
> config?
> >>>
> >>> Sure, for Xen 4.9 just do:
> >>>
> >>> PKG_CONFIG_PATH=$(DIR)/tools/pkg-config ./configure \
> >>> 		--enable-xen --target-list=i386-softmmu \
> >>> 		--disable-kvm
> >>> make
> >>
> >> Yes, that works, thanks! I committed it to my next branch adding
> >> "pkg-config, which is already a build dependency of QEMU, will be used
> >> exclusively to determine the Xen version from Xen 4.9 onward." to the
> >> commit message.
> >
> > A further question...
> >
> > I have a xen tree which I've been using to build and install master against
> my own checked out QEMU repo. No problem with that. I've now reverted
> my tree to 4.7.0 and cannot build tools (even after a make distclean) because
> QEMU's configure is still getting up a xen_ctrl_version of 40900. This is
> because pkg-config is still finding a 4.9.0 xencontrol package? Where is it
> getting this from?
> 
> Hmm, could it be you have Xen unstable installed on your machine?

I do indeed. I build on my test machine.

> 
> Didn't think of this problem. I can think of 3 solutions:
> 
> a) delete the xencontrol.pc file (on my system under
>    /usr/share/pkgconfig/ )
> 

I just found mine using pkg-config --debug... /usr/local/share/pkgconfig for me

> b) we add a patch to qemu to test an environment variable whether
>    pkg-config should be ignored for Xen version detection
> 
> c) set the environment variable PKG_CONFIG_LIBDIR to a local directory
>    and copy all but the xen*.pc files from /usr/share/pkgconfig/ (or
>    your correct directory) to it (or link them to avoid missing updates)
> 
> OTOH this is something you have to be aware of for other packages as
> well: mixing the build environment and the target environment can lead
> to bad results. Now Xen has been added to the list.
> 

That's a change in behaviour that I, and probably others, have long been used to. What we really want, presumably, is to have pkg-config just look under tools/pkgconfig when querying for the version of xencontrol. Could that not be done by simply setting PKG_CONFIG_LIBDIR in QEMU's configure script, or would it still mean picking up installed libraries before ones just built?

  Paul

> 
> Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [Xen-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version
  2017-03-24 15:44                       ` Paul Durrant
@ 2017-03-24 15:51                         ` Juergen Gross
  -1 siblings, 0 replies; 40+ messages in thread
From: Juergen Gross @ 2017-03-24 15:51 UTC (permalink / raw)
  To: Paul Durrant, 'Stefano Stabellini'
  Cc: Anthony Perard, xen-devel, qemu-devel, kraxel

On 24/03/17 16:44, Paul Durrant wrote:
>> -----Original Message-----
>> From: Juergen Gross [mailto:jgross@suse.com]
>> Sent: 24 March 2017 15:35
>> To: Paul Durrant <Paul.Durrant@citrix.com>; 'Stefano Stabellini'
>> <sstabellini@kernel.org>
>> Cc: Anthony Perard <anthony.perard@citrix.com>; xen-
>> devel@lists.xenproject.org; qemu-devel@nongnu.org; kraxel@redhat.com
>> Subject: Re: [Xen-devel] [PATCH 2/2] configure: use pkg-config for obtaining
>> xen version
>>
>> On 24/03/17 16:12, Paul Durrant wrote:
>>>> -----Original Message-----
>>>> From: Stefano Stabellini [mailto:sstabellini@kernel.org]
>>>> Sent: 22 March 2017 18:22
>>>> To: Juergen Gross <jgross@suse.com>
>>>> Cc: Stefano Stabellini <sstabellini@kernel.org>; qemu-
>> devel@nongnu.org;
>>>> xen-devel@lists.xenproject.org; Anthony Perard
>>>> <anthony.perard@citrix.com>; kraxel@redhat.com; Paul Durrant
>>>> <Paul.Durrant@citrix.com>
>>>> Subject: Re: [PATCH 2/2] configure: use pkg-config for obtaining xen
>> version
>>>>
>>>> On Wed, 22 Mar 2017, Juergen Gross wrote:
>>>>> On 21/03/17 19:54, Stefano Stabellini wrote:
>>>>>> On Tue, 21 Mar 2017, Juergen Gross wrote:
>>>>>>> On 17/03/17 19:33, Stefano Stabellini wrote:
>>>>>>>> On Fri, 17 Mar 2017, Juergen Gross wrote:
>>>>>>>>> On 16/03/17 21:20, Stefano Stabellini wrote:
>>>>>>>>>> On Thu, 16 Mar 2017, Juergen Gross wrote:
>>>>>>>>>>> Instead of trying to guess the Xen version to use by compiling
>>>> various
>>>>>>>>>>> test programs first just ask the system via pkg-config. Only if it
>>>>>>>>>>> can't return the version fall back to the test program scheme.
>>>>>>>>>>
>>>>>>>>>> That's OK, but why did you remove the Xen unstable test?
>>>>>>>>>
>>>>>>>>> >From Xen 4.9 on pkg-config will return the needed information.
>>>> There is
>>>>>>>>> no longer a need for a test program to determine the Xen version.
>>>> After
>>>>>>>>> all this was the main objective of my series adding the pkg-config
>>>>>>>>> files to Xen.
>>>>>>>>
>>>>>>>> I was going to say something like "yeah, but is pkg-config always
>>>>>>>> available?" In reality, QEMU already has pkg-config as build
>>>>>>>> dependency, so I guess there is no problem with that.
>>>>>>>>
>>>>>>>> Please add a note about this to the commit message.
>>>>>>>>
>>>>>>>
>>>>>>> Okay.
>>>>>>
>>>>>> Sorry to point this out only now, and I realize that it might be
>>>>>> unimportant for production builds, but it is important to me, and
>>>>>> developers in general, to be able to test a single QEMU tree against a
>>>>>> number of Xen trees (all releases from 4.3 onward).
>>>>>>
>>>>>> With this change (specifically dropping the 4.9 build test), out of tree
>>>>>> builds don't work anymore. I would like to be able to do:
>>>>>>
>>>>>> ./configure --enable-xen --target-list=i386-softmmu \
>>>>>>                 --extra-cflags="-I$DIR/tools/include \
>>>>>>                 -I$DIR/tools/libs/toollog/include \
>>>>>>                 -I$DIR/tools/libs/evtchn/include \
>>>>>>                 -I$DIR/tools/libs/gnttab/include \
>>>>>>                 -I$DIR/tools/libs/foreignmemory/include \
>>>>>>                 -I$DIR/tools/libs/devicemodel/include \
>>>>>>                 -I$DIR/tools/libxc/include \
>>>>>>                 -I$DIR/tools/xenstore/include \
>>>>>>                 -I$DIR/tools/xenstore/compat/include" \
>>>>>>                 --extra-ldflags="-L$DIR/tools/libxc \
>>>>>>                 -L$DIR/tools/xenstore \
>>>>>>                 -L$DIR/tools/libs/evtchn \
>>>>>>                 -L$DIR/tools/libs/gnttab \
>>>>>>                 -L$DIR/tools/libs/foreignmemory \
>>>>>>                 -L$DIR/tools/libs/devicemodel \
>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/toollog \
>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/evtchn \
>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/gnttab \
>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/call \
>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/foreignmemory \
>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/devicemodel" \
>>>>>>             --disable-kvm
>>>>>> make
>>>>>>
>>>>>> And the make should succeed. Is there a way to do that with pkg-
>> config?
>>>>>
>>>>> Sure, for Xen 4.9 just do:
>>>>>
>>>>> PKG_CONFIG_PATH=$(DIR)/tools/pkg-config ./configure \
>>>>> 		--enable-xen --target-list=i386-softmmu \
>>>>> 		--disable-kvm
>>>>> make
>>>>
>>>> Yes, that works, thanks! I committed it to my next branch adding
>>>> "pkg-config, which is already a build dependency of QEMU, will be used
>>>> exclusively to determine the Xen version from Xen 4.9 onward." to the
>>>> commit message.
>>>
>>> A further question...
>>>
>>> I have a xen tree which I've been using to build and install master against
>> my own checked out QEMU repo. No problem with that. I've now reverted
>> my tree to 4.7.0 and cannot build tools (even after a make distclean) because
>> QEMU's configure is still getting up a xen_ctrl_version of 40900. This is
>> because pkg-config is still finding a 4.9.0 xencontrol package? Where is it
>> getting this from?
>>
>> Hmm, could it be you have Xen unstable installed on your machine?
> 
> I do indeed. I build on my test machine.
> 
>>
>> Didn't think of this problem. I can think of 3 solutions:
>>
>> a) delete the xencontrol.pc file (on my system under
>>    /usr/share/pkgconfig/ )
>>
> 
> I just found mine using pkg-config --debug... /usr/local/share/pkgconfig for me
> 
>> b) we add a patch to qemu to test an environment variable whether
>>    pkg-config should be ignored for Xen version detection
>>
>> c) set the environment variable PKG_CONFIG_LIBDIR to a local directory
>>    and copy all but the xen*.pc files from /usr/share/pkgconfig/ (or
>>    your correct directory) to it (or link them to avoid missing updates)
>>
>> OTOH this is something you have to be aware of for other packages as
>> well: mixing the build environment and the target environment can lead
>> to bad results. Now Xen has been added to the list.
>>
> 
> That's a change in behaviour that I, and probably others, have long been used to. What we really want, presumably, is to have pkg-config just look under tools/pkgconfig when querying for the version of xencontrol. Could that not be done by simply setting PKG_CONFIG_LIBDIR in QEMU's configure script, or would it still mean picking up installed libraries before ones just built?

I guess this would break qemu's configure badly as it wouldn't find all
the other library informations it is looking for via pkg-config.


Juergen

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 2/2] configure: use pkg-config for obtaining xen version
@ 2017-03-24 15:51                         ` Juergen Gross
  0 siblings, 0 replies; 40+ messages in thread
From: Juergen Gross @ 2017-03-24 15:51 UTC (permalink / raw)
  To: Paul Durrant, 'Stefano Stabellini'
  Cc: Anthony Perard, xen-devel, qemu-devel, kraxel

On 24/03/17 16:44, Paul Durrant wrote:
>> -----Original Message-----
>> From: Juergen Gross [mailto:jgross@suse.com]
>> Sent: 24 March 2017 15:35
>> To: Paul Durrant <Paul.Durrant@citrix.com>; 'Stefano Stabellini'
>> <sstabellini@kernel.org>
>> Cc: Anthony Perard <anthony.perard@citrix.com>; xen-
>> devel@lists.xenproject.org; qemu-devel@nongnu.org; kraxel@redhat.com
>> Subject: Re: [Xen-devel] [PATCH 2/2] configure: use pkg-config for obtaining
>> xen version
>>
>> On 24/03/17 16:12, Paul Durrant wrote:
>>>> -----Original Message-----
>>>> From: Stefano Stabellini [mailto:sstabellini@kernel.org]
>>>> Sent: 22 March 2017 18:22
>>>> To: Juergen Gross <jgross@suse.com>
>>>> Cc: Stefano Stabellini <sstabellini@kernel.org>; qemu-
>> devel@nongnu.org;
>>>> xen-devel@lists.xenproject.org; Anthony Perard
>>>> <anthony.perard@citrix.com>; kraxel@redhat.com; Paul Durrant
>>>> <Paul.Durrant@citrix.com>
>>>> Subject: Re: [PATCH 2/2] configure: use pkg-config for obtaining xen
>> version
>>>>
>>>> On Wed, 22 Mar 2017, Juergen Gross wrote:
>>>>> On 21/03/17 19:54, Stefano Stabellini wrote:
>>>>>> On Tue, 21 Mar 2017, Juergen Gross wrote:
>>>>>>> On 17/03/17 19:33, Stefano Stabellini wrote:
>>>>>>>> On Fri, 17 Mar 2017, Juergen Gross wrote:
>>>>>>>>> On 16/03/17 21:20, Stefano Stabellini wrote:
>>>>>>>>>> On Thu, 16 Mar 2017, Juergen Gross wrote:
>>>>>>>>>>> Instead of trying to guess the Xen version to use by compiling
>>>> various
>>>>>>>>>>> test programs first just ask the system via pkg-config. Only if it
>>>>>>>>>>> can't return the version fall back to the test program scheme.
>>>>>>>>>>
>>>>>>>>>> That's OK, but why did you remove the Xen unstable test?
>>>>>>>>>
>>>>>>>>> >From Xen 4.9 on pkg-config will return the needed information.
>>>> There is
>>>>>>>>> no longer a need for a test program to determine the Xen version.
>>>> After
>>>>>>>>> all this was the main objective of my series adding the pkg-config
>>>>>>>>> files to Xen.
>>>>>>>>
>>>>>>>> I was going to say something like "yeah, but is pkg-config always
>>>>>>>> available?" In reality, QEMU already has pkg-config as build
>>>>>>>> dependency, so I guess there is no problem with that.
>>>>>>>>
>>>>>>>> Please add a note about this to the commit message.
>>>>>>>>
>>>>>>>
>>>>>>> Okay.
>>>>>>
>>>>>> Sorry to point this out only now, and I realize that it might be
>>>>>> unimportant for production builds, but it is important to me, and
>>>>>> developers in general, to be able to test a single QEMU tree against a
>>>>>> number of Xen trees (all releases from 4.3 onward).
>>>>>>
>>>>>> With this change (specifically dropping the 4.9 build test), out of tree
>>>>>> builds don't work anymore. I would like to be able to do:
>>>>>>
>>>>>> ./configure --enable-xen --target-list=i386-softmmu \
>>>>>>                 --extra-cflags="-I$DIR/tools/include \
>>>>>>                 -I$DIR/tools/libs/toollog/include \
>>>>>>                 -I$DIR/tools/libs/evtchn/include \
>>>>>>                 -I$DIR/tools/libs/gnttab/include \
>>>>>>                 -I$DIR/tools/libs/foreignmemory/include \
>>>>>>                 -I$DIR/tools/libs/devicemodel/include \
>>>>>>                 -I$DIR/tools/libxc/include \
>>>>>>                 -I$DIR/tools/xenstore/include \
>>>>>>                 -I$DIR/tools/xenstore/compat/include" \
>>>>>>                 --extra-ldflags="-L$DIR/tools/libxc \
>>>>>>                 -L$DIR/tools/xenstore \
>>>>>>                 -L$DIR/tools/libs/evtchn \
>>>>>>                 -L$DIR/tools/libs/gnttab \
>>>>>>                 -L$DIR/tools/libs/foreignmemory \
>>>>>>                 -L$DIR/tools/libs/devicemodel \
>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/toollog \
>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/evtchn \
>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/gnttab \
>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/call \
>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/foreignmemory \
>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/devicemodel" \
>>>>>>             --disable-kvm
>>>>>> make
>>>>>>
>>>>>> And the make should succeed. Is there a way to do that with pkg-
>> config?
>>>>>
>>>>> Sure, for Xen 4.9 just do:
>>>>>
>>>>> PKG_CONFIG_PATH=$(DIR)/tools/pkg-config ./configure \
>>>>> 		--enable-xen --target-list=i386-softmmu \
>>>>> 		--disable-kvm
>>>>> make
>>>>
>>>> Yes, that works, thanks! I committed it to my next branch adding
>>>> "pkg-config, which is already a build dependency of QEMU, will be used
>>>> exclusively to determine the Xen version from Xen 4.9 onward." to the
>>>> commit message.
>>>
>>> A further question...
>>>
>>> I have a xen tree which I've been using to build and install master against
>> my own checked out QEMU repo. No problem with that. I've now reverted
>> my tree to 4.7.0 and cannot build tools (even after a make distclean) because
>> QEMU's configure is still getting up a xen_ctrl_version of 40900. This is
>> because pkg-config is still finding a 4.9.0 xencontrol package? Where is it
>> getting this from?
>>
>> Hmm, could it be you have Xen unstable installed on your machine?
> 
> I do indeed. I build on my test machine.
> 
>>
>> Didn't think of this problem. I can think of 3 solutions:
>>
>> a) delete the xencontrol.pc file (on my system under
>>    /usr/share/pkgconfig/ )
>>
> 
> I just found mine using pkg-config --debug... /usr/local/share/pkgconfig for me
> 
>> b) we add a patch to qemu to test an environment variable whether
>>    pkg-config should be ignored for Xen version detection
>>
>> c) set the environment variable PKG_CONFIG_LIBDIR to a local directory
>>    and copy all but the xen*.pc files from /usr/share/pkgconfig/ (or
>>    your correct directory) to it (or link them to avoid missing updates)
>>
>> OTOH this is something you have to be aware of for other packages as
>> well: mixing the build environment and the target environment can lead
>> to bad results. Now Xen has been added to the list.
>>
> 
> That's a change in behaviour that I, and probably others, have long been used to. What we really want, presumably, is to have pkg-config just look under tools/pkgconfig when querying for the version of xencontrol. Could that not be done by simply setting PKG_CONFIG_LIBDIR in QEMU's configure script, or would it still mean picking up installed libraries before ones just built?

I guess this would break qemu's configure badly as it wouldn't find all
the other library informations it is looking for via pkg-config.


Juergen


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [Xen-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version
  2017-03-24 15:51                         ` Juergen Gross
@ 2017-03-24 15:54                           ` Juergen Gross
  -1 siblings, 0 replies; 40+ messages in thread
From: Juergen Gross @ 2017-03-24 15:54 UTC (permalink / raw)
  To: Paul Durrant, 'Stefano Stabellini'
  Cc: Anthony Perard, xen-devel, qemu-devel, kraxel

On 24/03/17 16:51, Juergen Gross wrote:
> On 24/03/17 16:44, Paul Durrant wrote:
>>> -----Original Message-----
>>> From: Juergen Gross [mailto:jgross@suse.com]
>>> Sent: 24 March 2017 15:35
>>> To: Paul Durrant <Paul.Durrant@citrix.com>; 'Stefano Stabellini'
>>> <sstabellini@kernel.org>
>>> Cc: Anthony Perard <anthony.perard@citrix.com>; xen-
>>> devel@lists.xenproject.org; qemu-devel@nongnu.org; kraxel@redhat.com
>>> Subject: Re: [Xen-devel] [PATCH 2/2] configure: use pkg-config for obtaining
>>> xen version
>>>
>>> On 24/03/17 16:12, Paul Durrant wrote:
>>>>> -----Original Message-----
>>>>> From: Stefano Stabellini [mailto:sstabellini@kernel.org]
>>>>> Sent: 22 March 2017 18:22
>>>>> To: Juergen Gross <jgross@suse.com>
>>>>> Cc: Stefano Stabellini <sstabellini@kernel.org>; qemu-
>>> devel@nongnu.org;
>>>>> xen-devel@lists.xenproject.org; Anthony Perard
>>>>> <anthony.perard@citrix.com>; kraxel@redhat.com; Paul Durrant
>>>>> <Paul.Durrant@citrix.com>
>>>>> Subject: Re: [PATCH 2/2] configure: use pkg-config for obtaining xen
>>> version
>>>>>
>>>>> On Wed, 22 Mar 2017, Juergen Gross wrote:
>>>>>> On 21/03/17 19:54, Stefano Stabellini wrote:
>>>>>>> On Tue, 21 Mar 2017, Juergen Gross wrote:
>>>>>>>> On 17/03/17 19:33, Stefano Stabellini wrote:
>>>>>>>>> On Fri, 17 Mar 2017, Juergen Gross wrote:
>>>>>>>>>> On 16/03/17 21:20, Stefano Stabellini wrote:
>>>>>>>>>>> On Thu, 16 Mar 2017, Juergen Gross wrote:
>>>>>>>>>>>> Instead of trying to guess the Xen version to use by compiling
>>>>> various
>>>>>>>>>>>> test programs first just ask the system via pkg-config. Only if it
>>>>>>>>>>>> can't return the version fall back to the test program scheme.
>>>>>>>>>>>
>>>>>>>>>>> That's OK, but why did you remove the Xen unstable test?
>>>>>>>>>>
>>>>>>>>>> >From Xen 4.9 on pkg-config will return the needed information.
>>>>> There is
>>>>>>>>>> no longer a need for a test program to determine the Xen version.
>>>>> After
>>>>>>>>>> all this was the main objective of my series adding the pkg-config
>>>>>>>>>> files to Xen.
>>>>>>>>>
>>>>>>>>> I was going to say something like "yeah, but is pkg-config always
>>>>>>>>> available?" In reality, QEMU already has pkg-config as build
>>>>>>>>> dependency, so I guess there is no problem with that.
>>>>>>>>>
>>>>>>>>> Please add a note about this to the commit message.
>>>>>>>>>
>>>>>>>>
>>>>>>>> Okay.
>>>>>>>
>>>>>>> Sorry to point this out only now, and I realize that it might be
>>>>>>> unimportant for production builds, but it is important to me, and
>>>>>>> developers in general, to be able to test a single QEMU tree against a
>>>>>>> number of Xen trees (all releases from 4.3 onward).
>>>>>>>
>>>>>>> With this change (specifically dropping the 4.9 build test), out of tree
>>>>>>> builds don't work anymore. I would like to be able to do:
>>>>>>>
>>>>>>> ./configure --enable-xen --target-list=i386-softmmu \
>>>>>>>                 --extra-cflags="-I$DIR/tools/include \
>>>>>>>                 -I$DIR/tools/libs/toollog/include \
>>>>>>>                 -I$DIR/tools/libs/evtchn/include \
>>>>>>>                 -I$DIR/tools/libs/gnttab/include \
>>>>>>>                 -I$DIR/tools/libs/foreignmemory/include \
>>>>>>>                 -I$DIR/tools/libs/devicemodel/include \
>>>>>>>                 -I$DIR/tools/libxc/include \
>>>>>>>                 -I$DIR/tools/xenstore/include \
>>>>>>>                 -I$DIR/tools/xenstore/compat/include" \
>>>>>>>                 --extra-ldflags="-L$DIR/tools/libxc \
>>>>>>>                 -L$DIR/tools/xenstore \
>>>>>>>                 -L$DIR/tools/libs/evtchn \
>>>>>>>                 -L$DIR/tools/libs/gnttab \
>>>>>>>                 -L$DIR/tools/libs/foreignmemory \
>>>>>>>                 -L$DIR/tools/libs/devicemodel \
>>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/toollog \
>>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/evtchn \
>>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/gnttab \
>>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/call \
>>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/foreignmemory \
>>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/devicemodel" \
>>>>>>>             --disable-kvm
>>>>>>> make
>>>>>>>
>>>>>>> And the make should succeed. Is there a way to do that with pkg-
>>> config?
>>>>>>
>>>>>> Sure, for Xen 4.9 just do:
>>>>>>
>>>>>> PKG_CONFIG_PATH=$(DIR)/tools/pkg-config ./configure \
>>>>>> 		--enable-xen --target-list=i386-softmmu \
>>>>>> 		--disable-kvm
>>>>>> make
>>>>>
>>>>> Yes, that works, thanks! I committed it to my next branch adding
>>>>> "pkg-config, which is already a build dependency of QEMU, will be used
>>>>> exclusively to determine the Xen version from Xen 4.9 onward." to the
>>>>> commit message.
>>>>
>>>> A further question...
>>>>
>>>> I have a xen tree which I've been using to build and install master against
>>> my own checked out QEMU repo. No problem with that. I've now reverted
>>> my tree to 4.7.0 and cannot build tools (even after a make distclean) because
>>> QEMU's configure is still getting up a xen_ctrl_version of 40900. This is
>>> because pkg-config is still finding a 4.9.0 xencontrol package? Where is it
>>> getting this from?
>>>
>>> Hmm, could it be you have Xen unstable installed on your machine?
>>
>> I do indeed. I build on my test machine.
>>
>>>
>>> Didn't think of this problem. I can think of 3 solutions:
>>>
>>> a) delete the xencontrol.pc file (on my system under
>>>    /usr/share/pkgconfig/ )
>>>
>>
>> I just found mine using pkg-config --debug... /usr/local/share/pkgconfig for me
>>
>>> b) we add a patch to qemu to test an environment variable whether
>>>    pkg-config should be ignored for Xen version detection
>>>
>>> c) set the environment variable PKG_CONFIG_LIBDIR to a local directory
>>>    and copy all but the xen*.pc files from /usr/share/pkgconfig/ (or
>>>    your correct directory) to it (or link them to avoid missing updates)
>>>
>>> OTOH this is something you have to be aware of for other packages as
>>> well: mixing the build environment and the target environment can lead
>>> to bad results. Now Xen has been added to the list.
>>>
>>
>> That's a change in behaviour that I, and probably others, have long been used to. What we really want, presumably, is to have pkg-config just look under tools/pkgconfig when querying for the version of xencontrol. Could that not be done by simply setting PKG_CONFIG_LIBDIR in QEMU's configure script, or would it still mean picking up installed libraries before ones just built?
> 
> I guess this would break qemu's configure badly as it wouldn't find all
> the other library informations it is looking for via pkg-config.

Aah, wait, you mean just for the Xen query?

This might complicate things for my qemu stubdom plans...


Juergen

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 2/2] configure: use pkg-config for obtaining xen version
@ 2017-03-24 15:54                           ` Juergen Gross
  0 siblings, 0 replies; 40+ messages in thread
From: Juergen Gross @ 2017-03-24 15:54 UTC (permalink / raw)
  To: Paul Durrant, 'Stefano Stabellini'
  Cc: Anthony Perard, xen-devel, qemu-devel, kraxel

On 24/03/17 16:51, Juergen Gross wrote:
> On 24/03/17 16:44, Paul Durrant wrote:
>>> -----Original Message-----
>>> From: Juergen Gross [mailto:jgross@suse.com]
>>> Sent: 24 March 2017 15:35
>>> To: Paul Durrant <Paul.Durrant@citrix.com>; 'Stefano Stabellini'
>>> <sstabellini@kernel.org>
>>> Cc: Anthony Perard <anthony.perard@citrix.com>; xen-
>>> devel@lists.xenproject.org; qemu-devel@nongnu.org; kraxel@redhat.com
>>> Subject: Re: [Xen-devel] [PATCH 2/2] configure: use pkg-config for obtaining
>>> xen version
>>>
>>> On 24/03/17 16:12, Paul Durrant wrote:
>>>>> -----Original Message-----
>>>>> From: Stefano Stabellini [mailto:sstabellini@kernel.org]
>>>>> Sent: 22 March 2017 18:22
>>>>> To: Juergen Gross <jgross@suse.com>
>>>>> Cc: Stefano Stabellini <sstabellini@kernel.org>; qemu-
>>> devel@nongnu.org;
>>>>> xen-devel@lists.xenproject.org; Anthony Perard
>>>>> <anthony.perard@citrix.com>; kraxel@redhat.com; Paul Durrant
>>>>> <Paul.Durrant@citrix.com>
>>>>> Subject: Re: [PATCH 2/2] configure: use pkg-config for obtaining xen
>>> version
>>>>>
>>>>> On Wed, 22 Mar 2017, Juergen Gross wrote:
>>>>>> On 21/03/17 19:54, Stefano Stabellini wrote:
>>>>>>> On Tue, 21 Mar 2017, Juergen Gross wrote:
>>>>>>>> On 17/03/17 19:33, Stefano Stabellini wrote:
>>>>>>>>> On Fri, 17 Mar 2017, Juergen Gross wrote:
>>>>>>>>>> On 16/03/17 21:20, Stefano Stabellini wrote:
>>>>>>>>>>> On Thu, 16 Mar 2017, Juergen Gross wrote:
>>>>>>>>>>>> Instead of trying to guess the Xen version to use by compiling
>>>>> various
>>>>>>>>>>>> test programs first just ask the system via pkg-config. Only if it
>>>>>>>>>>>> can't return the version fall back to the test program scheme.
>>>>>>>>>>>
>>>>>>>>>>> That's OK, but why did you remove the Xen unstable test?
>>>>>>>>>>
>>>>>>>>>> >From Xen 4.9 on pkg-config will return the needed information.
>>>>> There is
>>>>>>>>>> no longer a need for a test program to determine the Xen version.
>>>>> After
>>>>>>>>>> all this was the main objective of my series adding the pkg-config
>>>>>>>>>> files to Xen.
>>>>>>>>>
>>>>>>>>> I was going to say something like "yeah, but is pkg-config always
>>>>>>>>> available?" In reality, QEMU already has pkg-config as build
>>>>>>>>> dependency, so I guess there is no problem with that.
>>>>>>>>>
>>>>>>>>> Please add a note about this to the commit message.
>>>>>>>>>
>>>>>>>>
>>>>>>>> Okay.
>>>>>>>
>>>>>>> Sorry to point this out only now, and I realize that it might be
>>>>>>> unimportant for production builds, but it is important to me, and
>>>>>>> developers in general, to be able to test a single QEMU tree against a
>>>>>>> number of Xen trees (all releases from 4.3 onward).
>>>>>>>
>>>>>>> With this change (specifically dropping the 4.9 build test), out of tree
>>>>>>> builds don't work anymore. I would like to be able to do:
>>>>>>>
>>>>>>> ./configure --enable-xen --target-list=i386-softmmu \
>>>>>>>                 --extra-cflags="-I$DIR/tools/include \
>>>>>>>                 -I$DIR/tools/libs/toollog/include \
>>>>>>>                 -I$DIR/tools/libs/evtchn/include \
>>>>>>>                 -I$DIR/tools/libs/gnttab/include \
>>>>>>>                 -I$DIR/tools/libs/foreignmemory/include \
>>>>>>>                 -I$DIR/tools/libs/devicemodel/include \
>>>>>>>                 -I$DIR/tools/libxc/include \
>>>>>>>                 -I$DIR/tools/xenstore/include \
>>>>>>>                 -I$DIR/tools/xenstore/compat/include" \
>>>>>>>                 --extra-ldflags="-L$DIR/tools/libxc \
>>>>>>>                 -L$DIR/tools/xenstore \
>>>>>>>                 -L$DIR/tools/libs/evtchn \
>>>>>>>                 -L$DIR/tools/libs/gnttab \
>>>>>>>                 -L$DIR/tools/libs/foreignmemory \
>>>>>>>                 -L$DIR/tools/libs/devicemodel \
>>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/toollog \
>>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/evtchn \
>>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/gnttab \
>>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/call \
>>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/foreignmemory \
>>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/devicemodel" \
>>>>>>>             --disable-kvm
>>>>>>> make
>>>>>>>
>>>>>>> And the make should succeed. Is there a way to do that with pkg-
>>> config?
>>>>>>
>>>>>> Sure, for Xen 4.9 just do:
>>>>>>
>>>>>> PKG_CONFIG_PATH=$(DIR)/tools/pkg-config ./configure \
>>>>>> 		--enable-xen --target-list=i386-softmmu \
>>>>>> 		--disable-kvm
>>>>>> make
>>>>>
>>>>> Yes, that works, thanks! I committed it to my next branch adding
>>>>> "pkg-config, which is already a build dependency of QEMU, will be used
>>>>> exclusively to determine the Xen version from Xen 4.9 onward." to the
>>>>> commit message.
>>>>
>>>> A further question...
>>>>
>>>> I have a xen tree which I've been using to build and install master against
>>> my own checked out QEMU repo. No problem with that. I've now reverted
>>> my tree to 4.7.0 and cannot build tools (even after a make distclean) because
>>> QEMU's configure is still getting up a xen_ctrl_version of 40900. This is
>>> because pkg-config is still finding a 4.9.0 xencontrol package? Where is it
>>> getting this from?
>>>
>>> Hmm, could it be you have Xen unstable installed on your machine?
>>
>> I do indeed. I build on my test machine.
>>
>>>
>>> Didn't think of this problem. I can think of 3 solutions:
>>>
>>> a) delete the xencontrol.pc file (on my system under
>>>    /usr/share/pkgconfig/ )
>>>
>>
>> I just found mine using pkg-config --debug... /usr/local/share/pkgconfig for me
>>
>>> b) we add a patch to qemu to test an environment variable whether
>>>    pkg-config should be ignored for Xen version detection
>>>
>>> c) set the environment variable PKG_CONFIG_LIBDIR to a local directory
>>>    and copy all but the xen*.pc files from /usr/share/pkgconfig/ (or
>>>    your correct directory) to it (or link them to avoid missing updates)
>>>
>>> OTOH this is something you have to be aware of for other packages as
>>> well: mixing the build environment and the target environment can lead
>>> to bad results. Now Xen has been added to the list.
>>>
>>
>> That's a change in behaviour that I, and probably others, have long been used to. What we really want, presumably, is to have pkg-config just look under tools/pkgconfig when querying for the version of xencontrol. Could that not be done by simply setting PKG_CONFIG_LIBDIR in QEMU's configure script, or would it still mean picking up installed libraries before ones just built?
> 
> I guess this would break qemu's configure badly as it wouldn't find all
> the other library informations it is looking for via pkg-config.

Aah, wait, you mean just for the Xen query?

This might complicate things for my qemu stubdom plans...


Juergen


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [Xen-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version
  2017-03-24 15:54                           ` Juergen Gross
@ 2017-03-24 15:56                             ` Paul Durrant
  -1 siblings, 0 replies; 40+ messages in thread
From: Paul Durrant @ 2017-03-24 15:56 UTC (permalink / raw)
  To: 'Juergen Gross', 'Stefano Stabellini'
  Cc: Anthony Perard, xen-devel, qemu-devel, kraxel

> -----Original Message-----
> From: Juergen Gross [mailto:jgross@suse.com]
> Sent: 24 March 2017 15:55
> To: Paul Durrant <Paul.Durrant@citrix.com>; 'Stefano Stabellini'
> <sstabellini@kernel.org>
> Cc: Anthony Perard <anthony.perard@citrix.com>; xen-
> devel@lists.xenproject.org; qemu-devel@nongnu.org; kraxel@redhat.com
> Subject: Re: [Xen-devel] [PATCH 2/2] configure: use pkg-config for obtaining
> xen version
> 
> On 24/03/17 16:51, Juergen Gross wrote:
> > On 24/03/17 16:44, Paul Durrant wrote:
> >>> -----Original Message-----
> >>> From: Juergen Gross [mailto:jgross@suse.com]
> >>> Sent: 24 March 2017 15:35
> >>> To: Paul Durrant <Paul.Durrant@citrix.com>; 'Stefano Stabellini'
> >>> <sstabellini@kernel.org>
> >>> Cc: Anthony Perard <anthony.perard@citrix.com>; xen-
> >>> devel@lists.xenproject.org; qemu-devel@nongnu.org;
> kraxel@redhat.com
> >>> Subject: Re: [Xen-devel] [PATCH 2/2] configure: use pkg-config for
> obtaining
> >>> xen version
> >>>
> >>> On 24/03/17 16:12, Paul Durrant wrote:
> >>>>> -----Original Message-----
> >>>>> From: Stefano Stabellini [mailto:sstabellini@kernel.org]
> >>>>> Sent: 22 March 2017 18:22
> >>>>> To: Juergen Gross <jgross@suse.com>
> >>>>> Cc: Stefano Stabellini <sstabellini@kernel.org>; qemu-
> >>> devel@nongnu.org;
> >>>>> xen-devel@lists.xenproject.org; Anthony Perard
> >>>>> <anthony.perard@citrix.com>; kraxel@redhat.com; Paul Durrant
> >>>>> <Paul.Durrant@citrix.com>
> >>>>> Subject: Re: [PATCH 2/2] configure: use pkg-config for obtaining xen
> >>> version
> >>>>>
> >>>>> On Wed, 22 Mar 2017, Juergen Gross wrote:
> >>>>>> On 21/03/17 19:54, Stefano Stabellini wrote:
> >>>>>>> On Tue, 21 Mar 2017, Juergen Gross wrote:
> >>>>>>>> On 17/03/17 19:33, Stefano Stabellini wrote:
> >>>>>>>>> On Fri, 17 Mar 2017, Juergen Gross wrote:
> >>>>>>>>>> On 16/03/17 21:20, Stefano Stabellini wrote:
> >>>>>>>>>>> On Thu, 16 Mar 2017, Juergen Gross wrote:
> >>>>>>>>>>>> Instead of trying to guess the Xen version to use by
> compiling
> >>>>> various
> >>>>>>>>>>>> test programs first just ask the system via pkg-config. Only if
> it
> >>>>>>>>>>>> can't return the version fall back to the test program
> scheme.
> >>>>>>>>>>>
> >>>>>>>>>>> That's OK, but why did you remove the Xen unstable test?
> >>>>>>>>>>
> >>>>>>>>>> >From Xen 4.9 on pkg-config will return the needed
> information.
> >>>>> There is
> >>>>>>>>>> no longer a need for a test program to determine the Xen
> version.
> >>>>> After
> >>>>>>>>>> all this was the main objective of my series adding the pkg-
> config
> >>>>>>>>>> files to Xen.
> >>>>>>>>>
> >>>>>>>>> I was going to say something like "yeah, but is pkg-config always
> >>>>>>>>> available?" In reality, QEMU already has pkg-config as build
> >>>>>>>>> dependency, so I guess there is no problem with that.
> >>>>>>>>>
> >>>>>>>>> Please add a note about this to the commit message.
> >>>>>>>>>
> >>>>>>>>
> >>>>>>>> Okay.
> >>>>>>>
> >>>>>>> Sorry to point this out only now, and I realize that it might be
> >>>>>>> unimportant for production builds, but it is important to me, and
> >>>>>>> developers in general, to be able to test a single QEMU tree against
> a
> >>>>>>> number of Xen trees (all releases from 4.3 onward).
> >>>>>>>
> >>>>>>> With this change (specifically dropping the 4.9 build test), out of
> tree
> >>>>>>> builds don't work anymore. I would like to be able to do:
> >>>>>>>
> >>>>>>> ./configure --enable-xen --target-list=i386-softmmu \
> >>>>>>>                 --extra-cflags="-I$DIR/tools/include \
> >>>>>>>                 -I$DIR/tools/libs/toollog/include \
> >>>>>>>                 -I$DIR/tools/libs/evtchn/include \
> >>>>>>>                 -I$DIR/tools/libs/gnttab/include \
> >>>>>>>                 -I$DIR/tools/libs/foreignmemory/include \
> >>>>>>>                 -I$DIR/tools/libs/devicemodel/include \
> >>>>>>>                 -I$DIR/tools/libxc/include \
> >>>>>>>                 -I$DIR/tools/xenstore/include \
> >>>>>>>                 -I$DIR/tools/xenstore/compat/include" \
> >>>>>>>                 --extra-ldflags="-L$DIR/tools/libxc \
> >>>>>>>                 -L$DIR/tools/xenstore \
> >>>>>>>                 -L$DIR/tools/libs/evtchn \
> >>>>>>>                 -L$DIR/tools/libs/gnttab \
> >>>>>>>                 -L$DIR/tools/libs/foreignmemory \
> >>>>>>>                 -L$DIR/tools/libs/devicemodel \
> >>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/toollog \
> >>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/evtchn \
> >>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/gnttab \
> >>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/call \
> >>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/foreignmemory \
> >>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/devicemodel" \
> >>>>>>>             --disable-kvm
> >>>>>>> make
> >>>>>>>
> >>>>>>> And the make should succeed. Is there a way to do that with pkg-
> >>> config?
> >>>>>>
> >>>>>> Sure, for Xen 4.9 just do:
> >>>>>>
> >>>>>> PKG_CONFIG_PATH=$(DIR)/tools/pkg-config ./configure \
> >>>>>> 		--enable-xen --target-list=i386-softmmu \
> >>>>>> 		--disable-kvm
> >>>>>> make
> >>>>>
> >>>>> Yes, that works, thanks! I committed it to my next branch adding
> >>>>> "pkg-config, which is already a build dependency of QEMU, will be
> used
> >>>>> exclusively to determine the Xen version from Xen 4.9 onward." to
> the
> >>>>> commit message.
> >>>>
> >>>> A further question...
> >>>>
> >>>> I have a xen tree which I've been using to build and install master
> against
> >>> my own checked out QEMU repo. No problem with that. I've now
> reverted
> >>> my tree to 4.7.0 and cannot build tools (even after a make distclean)
> because
> >>> QEMU's configure is still getting up a xen_ctrl_version of 40900. This is
> >>> because pkg-config is still finding a 4.9.0 xencontrol package? Where is it
> >>> getting this from?
> >>>
> >>> Hmm, could it be you have Xen unstable installed on your machine?
> >>
> >> I do indeed. I build on my test machine.
> >>
> >>>
> >>> Didn't think of this problem. I can think of 3 solutions:
> >>>
> >>> a) delete the xencontrol.pc file (on my system under
> >>>    /usr/share/pkgconfig/ )
> >>>
> >>
> >> I just found mine using pkg-config --debug... /usr/local/share/pkgconfig
> for me
> >>
> >>> b) we add a patch to qemu to test an environment variable whether
> >>>    pkg-config should be ignored for Xen version detection
> >>>
> >>> c) set the environment variable PKG_CONFIG_LIBDIR to a local directory
> >>>    and copy all but the xen*.pc files from /usr/share/pkgconfig/ (or
> >>>    your correct directory) to it (or link them to avoid missing updates)
> >>>
> >>> OTOH this is something you have to be aware of for other packages as
> >>> well: mixing the build environment and the target environment can lead
> >>> to bad results. Now Xen has been added to the list.
> >>>
> >>
> >> That's a change in behaviour that I, and probably others, have long been
> used to. What we really want, presumably, is to have pkg-config just look
> under tools/pkgconfig when querying for the version of xencontrol. Could
> that not be done by simply setting PKG_CONFIG_LIBDIR in QEMU's configure
> script, or would it still mean picking up installed libraries before ones just
> built?
> >
> > I guess this would break qemu's configure badly as it wouldn't find all
> > the other library informations it is looking for via pkg-config.
> 
> Aah, wait, you mean just for the Xen query?
> 

Yes, we want QEMU to pick up xen libs from the build env and not any that have been previously installed the default search path needs to be squashed.

> This might complicate things for my qemu stubdom plans...
> 

Maybe that can be worked around in the stubdom build?

  Paul

> 
> Juergen


^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 2/2] configure: use pkg-config for obtaining xen version
@ 2017-03-24 15:56                             ` Paul Durrant
  0 siblings, 0 replies; 40+ messages in thread
From: Paul Durrant @ 2017-03-24 15:56 UTC (permalink / raw)
  To: 'Juergen Gross', 'Stefano Stabellini'
  Cc: Anthony Perard, xen-devel, qemu-devel, kraxel

> -----Original Message-----
> From: Juergen Gross [mailto:jgross@suse.com]
> Sent: 24 March 2017 15:55
> To: Paul Durrant <Paul.Durrant@citrix.com>; 'Stefano Stabellini'
> <sstabellini@kernel.org>
> Cc: Anthony Perard <anthony.perard@citrix.com>; xen-
> devel@lists.xenproject.org; qemu-devel@nongnu.org; kraxel@redhat.com
> Subject: Re: [Xen-devel] [PATCH 2/2] configure: use pkg-config for obtaining
> xen version
> 
> On 24/03/17 16:51, Juergen Gross wrote:
> > On 24/03/17 16:44, Paul Durrant wrote:
> >>> -----Original Message-----
> >>> From: Juergen Gross [mailto:jgross@suse.com]
> >>> Sent: 24 March 2017 15:35
> >>> To: Paul Durrant <Paul.Durrant@citrix.com>; 'Stefano Stabellini'
> >>> <sstabellini@kernel.org>
> >>> Cc: Anthony Perard <anthony.perard@citrix.com>; xen-
> >>> devel@lists.xenproject.org; qemu-devel@nongnu.org;
> kraxel@redhat.com
> >>> Subject: Re: [Xen-devel] [PATCH 2/2] configure: use pkg-config for
> obtaining
> >>> xen version
> >>>
> >>> On 24/03/17 16:12, Paul Durrant wrote:
> >>>>> -----Original Message-----
> >>>>> From: Stefano Stabellini [mailto:sstabellini@kernel.org]
> >>>>> Sent: 22 March 2017 18:22
> >>>>> To: Juergen Gross <jgross@suse.com>
> >>>>> Cc: Stefano Stabellini <sstabellini@kernel.org>; qemu-
> >>> devel@nongnu.org;
> >>>>> xen-devel@lists.xenproject.org; Anthony Perard
> >>>>> <anthony.perard@citrix.com>; kraxel@redhat.com; Paul Durrant
> >>>>> <Paul.Durrant@citrix.com>
> >>>>> Subject: Re: [PATCH 2/2] configure: use pkg-config for obtaining xen
> >>> version
> >>>>>
> >>>>> On Wed, 22 Mar 2017, Juergen Gross wrote:
> >>>>>> On 21/03/17 19:54, Stefano Stabellini wrote:
> >>>>>>> On Tue, 21 Mar 2017, Juergen Gross wrote:
> >>>>>>>> On 17/03/17 19:33, Stefano Stabellini wrote:
> >>>>>>>>> On Fri, 17 Mar 2017, Juergen Gross wrote:
> >>>>>>>>>> On 16/03/17 21:20, Stefano Stabellini wrote:
> >>>>>>>>>>> On Thu, 16 Mar 2017, Juergen Gross wrote:
> >>>>>>>>>>>> Instead of trying to guess the Xen version to use by
> compiling
> >>>>> various
> >>>>>>>>>>>> test programs first just ask the system via pkg-config. Only if
> it
> >>>>>>>>>>>> can't return the version fall back to the test program
> scheme.
> >>>>>>>>>>>
> >>>>>>>>>>> That's OK, but why did you remove the Xen unstable test?
> >>>>>>>>>>
> >>>>>>>>>> >From Xen 4.9 on pkg-config will return the needed
> information.
> >>>>> There is
> >>>>>>>>>> no longer a need for a test program to determine the Xen
> version.
> >>>>> After
> >>>>>>>>>> all this was the main objective of my series adding the pkg-
> config
> >>>>>>>>>> files to Xen.
> >>>>>>>>>
> >>>>>>>>> I was going to say something like "yeah, but is pkg-config always
> >>>>>>>>> available?" In reality, QEMU already has pkg-config as build
> >>>>>>>>> dependency, so I guess there is no problem with that.
> >>>>>>>>>
> >>>>>>>>> Please add a note about this to the commit message.
> >>>>>>>>>
> >>>>>>>>
> >>>>>>>> Okay.
> >>>>>>>
> >>>>>>> Sorry to point this out only now, and I realize that it might be
> >>>>>>> unimportant for production builds, but it is important to me, and
> >>>>>>> developers in general, to be able to test a single QEMU tree against
> a
> >>>>>>> number of Xen trees (all releases from 4.3 onward).
> >>>>>>>
> >>>>>>> With this change (specifically dropping the 4.9 build test), out of
> tree
> >>>>>>> builds don't work anymore. I would like to be able to do:
> >>>>>>>
> >>>>>>> ./configure --enable-xen --target-list=i386-softmmu \
> >>>>>>>                 --extra-cflags="-I$DIR/tools/include \
> >>>>>>>                 -I$DIR/tools/libs/toollog/include \
> >>>>>>>                 -I$DIR/tools/libs/evtchn/include \
> >>>>>>>                 -I$DIR/tools/libs/gnttab/include \
> >>>>>>>                 -I$DIR/tools/libs/foreignmemory/include \
> >>>>>>>                 -I$DIR/tools/libs/devicemodel/include \
> >>>>>>>                 -I$DIR/tools/libxc/include \
> >>>>>>>                 -I$DIR/tools/xenstore/include \
> >>>>>>>                 -I$DIR/tools/xenstore/compat/include" \
> >>>>>>>                 --extra-ldflags="-L$DIR/tools/libxc \
> >>>>>>>                 -L$DIR/tools/xenstore \
> >>>>>>>                 -L$DIR/tools/libs/evtchn \
> >>>>>>>                 -L$DIR/tools/libs/gnttab \
> >>>>>>>                 -L$DIR/tools/libs/foreignmemory \
> >>>>>>>                 -L$DIR/tools/libs/devicemodel \
> >>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/toollog \
> >>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/evtchn \
> >>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/gnttab \
> >>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/call \
> >>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/foreignmemory \
> >>>>>>>                 -Wl,-rpath-link=$DIR/tools/libs/devicemodel" \
> >>>>>>>             --disable-kvm
> >>>>>>> make
> >>>>>>>
> >>>>>>> And the make should succeed. Is there a way to do that with pkg-
> >>> config?
> >>>>>>
> >>>>>> Sure, for Xen 4.9 just do:
> >>>>>>
> >>>>>> PKG_CONFIG_PATH=$(DIR)/tools/pkg-config ./configure \
> >>>>>> 		--enable-xen --target-list=i386-softmmu \
> >>>>>> 		--disable-kvm
> >>>>>> make
> >>>>>
> >>>>> Yes, that works, thanks! I committed it to my next branch adding
> >>>>> "pkg-config, which is already a build dependency of QEMU, will be
> used
> >>>>> exclusively to determine the Xen version from Xen 4.9 onward." to
> the
> >>>>> commit message.
> >>>>
> >>>> A further question...
> >>>>
> >>>> I have a xen tree which I've been using to build and install master
> against
> >>> my own checked out QEMU repo. No problem with that. I've now
> reverted
> >>> my tree to 4.7.0 and cannot build tools (even after a make distclean)
> because
> >>> QEMU's configure is still getting up a xen_ctrl_version of 40900. This is
> >>> because pkg-config is still finding a 4.9.0 xencontrol package? Where is it
> >>> getting this from?
> >>>
> >>> Hmm, could it be you have Xen unstable installed on your machine?
> >>
> >> I do indeed. I build on my test machine.
> >>
> >>>
> >>> Didn't think of this problem. I can think of 3 solutions:
> >>>
> >>> a) delete the xencontrol.pc file (on my system under
> >>>    /usr/share/pkgconfig/ )
> >>>
> >>
> >> I just found mine using pkg-config --debug... /usr/local/share/pkgconfig
> for me
> >>
> >>> b) we add a patch to qemu to test an environment variable whether
> >>>    pkg-config should be ignored for Xen version detection
> >>>
> >>> c) set the environment variable PKG_CONFIG_LIBDIR to a local directory
> >>>    and copy all but the xen*.pc files from /usr/share/pkgconfig/ (or
> >>>    your correct directory) to it (or link them to avoid missing updates)
> >>>
> >>> OTOH this is something you have to be aware of for other packages as
> >>> well: mixing the build environment and the target environment can lead
> >>> to bad results. Now Xen has been added to the list.
> >>>
> >>
> >> That's a change in behaviour that I, and probably others, have long been
> used to. What we really want, presumably, is to have pkg-config just look
> under tools/pkgconfig when querying for the version of xencontrol. Could
> that not be done by simply setting PKG_CONFIG_LIBDIR in QEMU's configure
> script, or would it still mean picking up installed libraries before ones just
> built?
> >
> > I guess this would break qemu's configure badly as it wouldn't find all
> > the other library informations it is looking for via pkg-config.
> 
> Aah, wait, you mean just for the Xen query?
> 

Yes, we want QEMU to pick up xen libs from the build env and not any that have been previously installed the default search path needs to be squashed.

> This might complicate things for my qemu stubdom plans...
> 

Maybe that can be worked around in the stubdom build?

  Paul

> 
> Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [Xen-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version
  2017-03-24 15:54                           ` Juergen Gross
@ 2017-03-24 16:42                             ` Paul Durrant
  -1 siblings, 0 replies; 40+ messages in thread
From: Paul Durrant @ 2017-03-24 16:42 UTC (permalink / raw)
  To: 'Juergen Gross', 'Stefano Stabellini'
  Cc: Anthony Perard, xen-devel, qemu-devel, kraxel

> -----Original Message-----
[snip]
> >> That's a change in behaviour that I, and probably others, have long been
> used to. What we really want, presumably, is to have pkg-config just look
> under tools/pkgconfig when querying for the version of xencontrol. Could
> that not be done by simply setting PKG_CONFIG_LIBDIR in QEMU's configure
> script, or would it still mean picking up installed libraries before ones just
> built?
> >
> > I guess this would break qemu's configure badly as it wouldn't find all
> > the other library informations it is looking for via pkg-config.
> 
> Aah, wait, you mean just for the Xen query?
> 
> This might complicate things for my qemu stubdom plans...
> 

How about this patch to QEMU configure?

diff --git a/configure b/configure
index fdf47e4..6ef5980 100755
--- a/configure
+++ b/configure
@@ -1974,6 +1974,10 @@ fi
 ##########################################
 # xen probe

+xen_query_pkg_config() {
+    PKG_CONFIG_LIBDIR= ${pkg_config_exe} "$@"
+}
+
 if test "$xen" != "no" ; then
   xen_libs="-lxenstore -lxenctrl -lxenguest"
   xen_stable_libs="-lxenforeignmemory -lxengnttab -lxenevtchn"
@@ -1997,9 +2001,9 @@ EOF
     xen=no

   # Xen version via pkg-config (Xen 4.9.0 and newer)
-  elif $pkg_config --exists xencontrol ; then
+  elif xen_query_pkg_config --exists xencontrol; then
     xen_ctrl_version="$(printf '%d%02d%02d' \
-      $($pkg_config --modversion xencontrol | sed 's/\./ /g') )"
+      $(xen_query_pkg_config --modversion xencontrol | sed 's/\./ /g') )"
     xen=yes

   elif
@@ -2216,8 +2220,8 @@ EOF
     if test $xen_ctrl_version -ge 40900 ; then
       xen_pc="xencontrol xenstore xenguest xenforeignmemory xengnttab xenevtchn"
       xen_pc="$xen_pc xendevicemodel"
-      xen_libs="$($pkg_config --libs $xen_pc)"
-      QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)"
+      xen_libs="$(xen_query_pkg_config --libs $xen_pc)"
+      QEMU_CFLAGS="$QEMU_CFLAGS $(xen_query_pkg_config --cflags $xen_pc)"
     elif test $xen_ctrl_version -ge 40701 ; then
       libs_softmmu="$xen_stable_libs $libs_softmmu"
     fi

This appears to DTRT for me when switching between versions of Xen.

  Paul

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* Re: [PATCH 2/2] configure: use pkg-config for obtaining xen version
@ 2017-03-24 16:42                             ` Paul Durrant
  0 siblings, 0 replies; 40+ messages in thread
From: Paul Durrant @ 2017-03-24 16:42 UTC (permalink / raw)
  To: 'Juergen Gross', 'Stefano Stabellini'
  Cc: Anthony Perard, xen-devel, qemu-devel, kraxel

> -----Original Message-----
[snip]
> >> That's a change in behaviour that I, and probably others, have long been
> used to. What we really want, presumably, is to have pkg-config just look
> under tools/pkgconfig when querying for the version of xencontrol. Could
> that not be done by simply setting PKG_CONFIG_LIBDIR in QEMU's configure
> script, or would it still mean picking up installed libraries before ones just
> built?
> >
> > I guess this would break qemu's configure badly as it wouldn't find all
> > the other library informations it is looking for via pkg-config.
> 
> Aah, wait, you mean just for the Xen query?
> 
> This might complicate things for my qemu stubdom plans...
> 

How about this patch to QEMU configure?

diff --git a/configure b/configure
index fdf47e4..6ef5980 100755
--- a/configure
+++ b/configure
@@ -1974,6 +1974,10 @@ fi
 ##########################################
 # xen probe

+xen_query_pkg_config() {
+    PKG_CONFIG_LIBDIR= ${pkg_config_exe} "$@"
+}
+
 if test "$xen" != "no" ; then
   xen_libs="-lxenstore -lxenctrl -lxenguest"
   xen_stable_libs="-lxenforeignmemory -lxengnttab -lxenevtchn"
@@ -1997,9 +2001,9 @@ EOF
     xen=no

   # Xen version via pkg-config (Xen 4.9.0 and newer)
-  elif $pkg_config --exists xencontrol ; then
+  elif xen_query_pkg_config --exists xencontrol; then
     xen_ctrl_version="$(printf '%d%02d%02d' \
-      $($pkg_config --modversion xencontrol | sed 's/\./ /g') )"
+      $(xen_query_pkg_config --modversion xencontrol | sed 's/\./ /g') )"
     xen=yes

   elif
@@ -2216,8 +2220,8 @@ EOF
     if test $xen_ctrl_version -ge 40900 ; then
       xen_pc="xencontrol xenstore xenguest xenforeignmemory xengnttab xenevtchn"
       xen_pc="$xen_pc xendevicemodel"
-      xen_libs="$($pkg_config --libs $xen_pc)"
-      QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)"
+      xen_libs="$(xen_query_pkg_config --libs $xen_pc)"
+      QEMU_CFLAGS="$QEMU_CFLAGS $(xen_query_pkg_config --cflags $xen_pc)"
     elif test $xen_ctrl_version -ge 40701 ; then
       libs_softmmu="$xen_stable_libs $libs_softmmu"
     fi

This appears to DTRT for me when switching between versions of Xen.

  Paul
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 40+ messages in thread

* Re: [Qemu-devel] [Xen-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version
  2017-03-24 16:42                             ` Paul Durrant
@ 2017-03-24 18:43                               ` Juergen Gross
  -1 siblings, 0 replies; 40+ messages in thread
From: Juergen Gross @ 2017-03-24 18:43 UTC (permalink / raw)
  To: Paul Durrant, 'Stefano Stabellini'
  Cc: Anthony Perard, xen-devel, qemu-devel, kraxel

On 24/03/17 17:42, Paul Durrant wrote:
>> -----Original Message-----
> [snip]
>>>> That's a change in behaviour that I, and probably others, have long been
>> used to. What we really want, presumably, is to have pkg-config just look
>> under tools/pkgconfig when querying for the version of xencontrol. Could
>> that not be done by simply setting PKG_CONFIG_LIBDIR in QEMU's configure
>> script, or would it still mean picking up installed libraries before ones just
>> built?
>>>
>>> I guess this would break qemu's configure badly as it wouldn't find all
>>> the other library informations it is looking for via pkg-config.
>>
>> Aah, wait, you mean just for the Xen query?
>>
>> This might complicate things for my qemu stubdom plans...
>>
> 
> How about this patch to QEMU configure?
> 
> diff --git a/configure b/configure
> index fdf47e4..6ef5980 100755
> --- a/configure
> +++ b/configure
> @@ -1974,6 +1974,10 @@ fi
>  ##########################################
>  # xen probe
> 
> +xen_query_pkg_config() {
> +    PKG_CONFIG_LIBDIR= ${pkg_config_exe} "$@"
> +}
> +
>  if test "$xen" != "no" ; then
>    xen_libs="-lxenstore -lxenctrl -lxenguest"
>    xen_stable_libs="-lxenforeignmemory -lxengnttab -lxenevtchn"
> @@ -1997,9 +2001,9 @@ EOF
>      xen=no
> 
>    # Xen version via pkg-config (Xen 4.9.0 and newer)
> -  elif $pkg_config --exists xencontrol ; then
> +  elif xen_query_pkg_config --exists xencontrol; then
>      xen_ctrl_version="$(printf '%d%02d%02d' \
> -      $($pkg_config --modversion xencontrol | sed 's/\./ /g') )"
> +      $(xen_query_pkg_config --modversion xencontrol | sed 's/\./ /g') )"
>      xen=yes
> 
>    elif
> @@ -2216,8 +2220,8 @@ EOF
>      if test $xen_ctrl_version -ge 40900 ; then
>        xen_pc="xencontrol xenstore xenguest xenforeignmemory xengnttab xenevtchn"
>        xen_pc="$xen_pc xendevicemodel"
> -      xen_libs="$($pkg_config --libs $xen_pc)"
> -      QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)"
> +      xen_libs="$(xen_query_pkg_config --libs $xen_pc)"
> +      QEMU_CFLAGS="$QEMU_CFLAGS $(xen_query_pkg_config --cflags $xen_pc)"
>      elif test $xen_ctrl_version -ge 40701 ; then
>        libs_softmmu="$xen_stable_libs $libs_softmmu"
>      fi
> 
> This appears to DTRT for me when switching between versions of Xen.

But not for someone trying to build qemu outside of Xen trying to use
the properly installed pkg-config files of Xen. They wouldn't be
found any more.

You are breaking a feature for the majority of users just to make
live easier for a handful of developers unwilling to change their
workflow.


Juergen

^ permalink raw reply	[flat|nested] 40+ messages in thread

* Re: [PATCH 2/2] configure: use pkg-config for obtaining xen version
@ 2017-03-24 18:43                               ` Juergen Gross
  0 siblings, 0 replies; 40+ messages in thread
From: Juergen Gross @ 2017-03-24 18:43 UTC (permalink / raw)
  To: Paul Durrant, 'Stefano Stabellini'
  Cc: Anthony Perard, xen-devel, qemu-devel, kraxel

On 24/03/17 17:42, Paul Durrant wrote:
>> -----Original Message-----
> [snip]
>>>> That's a change in behaviour that I, and probably others, have long been
>> used to. What we really want, presumably, is to have pkg-config just look
>> under tools/pkgconfig when querying for the version of xencontrol. Could
>> that not be done by simply setting PKG_CONFIG_LIBDIR in QEMU's configure
>> script, or would it still mean picking up installed libraries before ones just
>> built?
>>>
>>> I guess this would break qemu's configure badly as it wouldn't find all
>>> the other library informations it is looking for via pkg-config.
>>
>> Aah, wait, you mean just for the Xen query?
>>
>> This might complicate things for my qemu stubdom plans...
>>
> 
> How about this patch to QEMU configure?
> 
> diff --git a/configure b/configure
> index fdf47e4..6ef5980 100755
> --- a/configure
> +++ b/configure
> @@ -1974,6 +1974,10 @@ fi
>  ##########################################
>  # xen probe
> 
> +xen_query_pkg_config() {
> +    PKG_CONFIG_LIBDIR= ${pkg_config_exe} "$@"
> +}
> +
>  if test "$xen" != "no" ; then
>    xen_libs="-lxenstore -lxenctrl -lxenguest"
>    xen_stable_libs="-lxenforeignmemory -lxengnttab -lxenevtchn"
> @@ -1997,9 +2001,9 @@ EOF
>      xen=no
> 
>    # Xen version via pkg-config (Xen 4.9.0 and newer)
> -  elif $pkg_config --exists xencontrol ; then
> +  elif xen_query_pkg_config --exists xencontrol; then
>      xen_ctrl_version="$(printf '%d%02d%02d' \
> -      $($pkg_config --modversion xencontrol | sed 's/\./ /g') )"
> +      $(xen_query_pkg_config --modversion xencontrol | sed 's/\./ /g') )"
>      xen=yes
> 
>    elif
> @@ -2216,8 +2220,8 @@ EOF
>      if test $xen_ctrl_version -ge 40900 ; then
>        xen_pc="xencontrol xenstore xenguest xenforeignmemory xengnttab xenevtchn"
>        xen_pc="$xen_pc xendevicemodel"
> -      xen_libs="$($pkg_config --libs $xen_pc)"
> -      QEMU_CFLAGS="$QEMU_CFLAGS $($pkg_config --cflags $xen_pc)"
> +      xen_libs="$(xen_query_pkg_config --libs $xen_pc)"
> +      QEMU_CFLAGS="$QEMU_CFLAGS $(xen_query_pkg_config --cflags $xen_pc)"
>      elif test $xen_ctrl_version -ge 40701 ; then
>        libs_softmmu="$xen_stable_libs $libs_softmmu"
>      fi
> 
> This appears to DTRT for me when switching between versions of Xen.

But not for someone trying to build qemu outside of Xen trying to use
the properly installed pkg-config files of Xen. They wouldn't be
found any more.

You are breaking a feature for the majority of users just to make
live easier for a handful of developers unwilling to change their
workflow.


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 40+ messages in thread

end of thread, other threads:[~2017-03-24 18:43 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-16 14:19 [Qemu-devel] [PATCH 0/2] xen: use pkg-config for configure Juergen Gross
2017-03-16 14:19 ` Juergen Gross
2017-03-16 14:19 ` [Qemu-devel] [PATCH 1/2] xen: use 5 digit xen versions Juergen Gross
2017-03-16 14:19   ` Juergen Gross
2017-03-16 20:19   ` [Qemu-devel] " Stefano Stabellini
2017-03-16 20:19     ` Stefano Stabellini
2017-03-16 14:19 ` [Qemu-devel] [PATCH 2/2] configure: use pkg-config for obtaining xen version Juergen Gross
2017-03-16 14:19   ` Juergen Gross
2017-03-16 20:20   ` [Qemu-devel] " Stefano Stabellini
2017-03-16 20:20     ` Stefano Stabellini
2017-03-17  4:49     ` [Qemu-devel] " Juergen Gross
2017-03-17  4:49       ` Juergen Gross
2017-03-17 18:33       ` [Qemu-devel] " Stefano Stabellini
2017-03-17 18:33         ` Stefano Stabellini
2017-03-21  5:34         ` [Qemu-devel] " Juergen Gross
2017-03-21  5:34           ` Juergen Gross
2017-03-21 18:54           ` [Qemu-devel] " Stefano Stabellini
2017-03-21 18:54             ` Stefano Stabellini
2017-03-22  5:02             ` [Qemu-devel] " Juergen Gross
2017-03-22  5:02               ` Juergen Gross
2017-03-22 18:21               ` [Qemu-devel] " Stefano Stabellini
2017-03-22 18:21                 ` Stefano Stabellini
2017-03-24 15:12                 ` [Qemu-devel] " Paul Durrant
2017-03-24 15:12                   ` Paul Durrant
2017-03-24 15:24                   ` [Qemu-devel] " Paul Durrant
2017-03-24 15:24                     ` Paul Durrant
2017-03-24 15:34                   ` [Qemu-devel] [Xen-devel] " Juergen Gross
2017-03-24 15:34                     ` Juergen Gross
2017-03-24 15:44                     ` [Qemu-devel] [Xen-devel] " Paul Durrant
2017-03-24 15:44                       ` Paul Durrant
2017-03-24 15:51                       ` [Qemu-devel] [Xen-devel] " Juergen Gross
2017-03-24 15:51                         ` Juergen Gross
2017-03-24 15:54                         ` [Qemu-devel] [Xen-devel] " Juergen Gross
2017-03-24 15:54                           ` Juergen Gross
2017-03-24 15:56                           ` [Qemu-devel] [Xen-devel] " Paul Durrant
2017-03-24 15:56                             ` Paul Durrant
2017-03-24 16:42                           ` [Qemu-devel] [Xen-devel] " Paul Durrant
2017-03-24 16:42                             ` Paul Durrant
2017-03-24 18:43                             ` [Qemu-devel] [Xen-devel] " Juergen Gross
2017-03-24 18:43                               ` Juergen Gross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.