Re: [libvirt] [PATCH] allow to set path to xen userspace tools

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 07, 2009 at 01:16:02PM +0200, Guido G?nther wrote:
> Hi,
> attached patch makes the path to the xen userspace tools configurable.
> Debian keeps this under /usr/lib/xen-default/ instead of /usr/lib/xen/.
> We don't have the amd64 libs in /usr/lib64/xen either so we can use:
>  ./configure --with-xen-tools=/usr/lib/xen-defaults --with-xen-tools64=/usr/lib/xen-defaults
> instead of patching src/xen_internals.c directly.
> Skipping above options gives the current behaviour. I checked that "make
> check" still passes. O.k. to apply?

The code changes look ok, but I'm not much of a fan of the way the
test cases are handled here, with all these data files listed in
configure.in  

I think i'd be more inclined to let virtTestLoadFile() do the subsitution
at time its loading the files. Perhaps

   if (virtTestLoadFile(xml, &expectxml, MAX_FILE, {
         "@XEN_TOOLS@", XEN_TOOLS,
       }) < 0)
      goto fail;


Regards,
Daniel

> >From 494e65d99e5e533c3e1ca23d80af0536fa0a64d2 Mon Sep 17 00:00:00 2001
> From: =?utf-8?q?Guido=20G=C3=BCnther?= <agx@xxxxxxxxxxx>
> Date: Mon, 6 Jul 2009 21:22:18 +0200
> Subject: [PATCH] introduce XEN_TOOLS dir
> 
> ---
>  configure.in                                       |   33 ++++++++++++++++++++
>  src/xen_internal.c                                 |    6 ++--
>  tests/xencapsdata/Makefile.am                      |    2 +-
>  ...en-i686-pae-hvm.xml => xen-i686-pae-hvm.xml.in} |    6 ++--
>  .../{xen-i686-pae.xml => xen-i686-pae.xml.in}      |    2 +-
>  .../xencapsdata/{xen-i686.xml => xen-i686.xml.in}  |    2 +-
>  ...{xen-ia64-be-hvm.xml => xen-ia64-be-hvm.xml.in} |    6 ++--
>  .../{xen-ia64-be.xml => xen-ia64-be.xml.in}        |    2 +-
>  .../{xen-ia64-hvm.xml => xen-ia64-hvm.xml.in}      |    6 ++--
>  .../xencapsdata/{xen-ia64.xml => xen-ia64.xml.in}  |    2 +-
>  .../{xen-ppc64.xml => xen-ppc64.xml.in}            |    2 +-
>  .../{xen-x86_64-hvm.xml => xen-x86_64-hvm.xml.in}  |   10 +++---
>  .../{xen-x86_64.xml => xen-x86_64.xml.in}          |    2 +-
>  13 files changed, 57 insertions(+), 24 deletions(-)
>  rename tests/xencapsdata/{xen-i686-pae-hvm.xml => xen-i686-pae-hvm.xml.in} (84%)
>  rename tests/xencapsdata/{xen-i686-pae.xml => xen-i686-pae.xml.in} (91%)
>  rename tests/xencapsdata/{xen-i686.xml => xen-i686.xml.in} (90%)
>  rename tests/xencapsdata/{xen-ia64-be-hvm.xml => xen-ia64-be-hvm.xml.in} (83%)
>  rename tests/xencapsdata/{xen-ia64-be.xml => xen-ia64-be.xml.in} (90%)
>  rename tests/xencapsdata/{xen-ia64-hvm.xml => xen-ia64-hvm.xml.in} (82%)
>  rename tests/xencapsdata/{xen-ia64.xml => xen-ia64.xml.in} (89%)
>  rename tests/xencapsdata/{xen-ppc64.xml => xen-ppc64.xml.in} (89%)
>  rename tests/xencapsdata/{xen-x86_64-hvm.xml => xen-x86_64-hvm.xml.in} (80%)
>  rename tests/xencapsdata/{xen-x86_64.xml => xen-x86_64.xml.in} (90%)
> 
> diff --git a/configure.in b/configure.in
> index 29c8867..b7829ee 100644
> --- a/configure.in
> +++ b/configure.in
> @@ -1182,6 +1182,29 @@ AC_MSG_RESULT($RUNNING_XEND)
>  
>  AM_CONDITIONAL([ENABLE_XEN_TESTS], [test "$RUNNING_XEN" != "no" -a "$RUNNING_XEND" != "no"])
>  
> +
> +AC_MSG_CHECKING([location of xen userspace tools])
> +AC_ARG_WITH([xen-tools], [AC_HELP_STRING([--with-xen-tools=[path]], [path to xen tools])])
> +if test "x$with_xen_tools" == "x" ; then
> +   XEN_TOOLS="/usr/lib/xen"
> +else
> +   XEN_TOOLS="$with_xen_tools"
> +fi
> +AC_SUBST([XEN_TOOLS], [$XEN_TOOLS])
> +AC_DEFINE_UNQUOTED([XEN_TOOLS], ["$XEN_TOOLS"], [path to xen tools])
> +AC_MSG_RESULT($XEN_TOOLS)
> +
> +AC_MSG_CHECKING([location of 64bit xen userspace tools])
> +AC_ARG_WITH([xen-tools], [AC_HELP_STRING([--with-xen-tools64=[path]], [path to xen 64bit tools])])
> +if test "x$with_xen_tools64" == "x" ; then
> +   XEN_TOOLS64="/usr/lib64/xen"
> +else
> +   XEN_TOOLS64="$with_xen_tools64"
> +fi
> +AC_SUBST([XEN_TOOLS64], [$XEN_TOOLS64])
> +AC_DEFINE_UNQUOTED([XEN_TOOLS64], ["$XEN_TOOLS64"], [path to 64bit xen tools])
> +AC_MSG_RESULT($XEN_TOOLS64)
> +
>  AC_ARG_ENABLE([test-coverage],
>  [  --enable-test-coverage  turn on code coverage instrumentation],
>  [case "${enableval}" in
> @@ -1460,6 +1483,16 @@ AC_OUTPUT(Makefile src/Makefile include/Makefile docs/Makefile \
>            tests/sexpr2xmldata/Makefile \
>            tests/xmconfigdata/Makefile \
>            tests/xencapsdata/Makefile \
> +          tests/xencapsdata/xen-i686.xml
> +          tests/xencapsdata/xen-i686-pae.xml
> +          tests/xencapsdata/xen-i686-pae-hvm.xml \
> +          tests/xencapsdata/xen-ia64-be-hvm.xml \
> +          tests/xencapsdata/xen-ia64-be.xml
> +          tests/xencapsdata/xen-ia64.xml
> +          tests/xencapsdata/xen-ia64-hvm.xml \
> +          tests/xencapsdata/xen-x86_64.xml
> +          tests/xencapsdata/xen-x86_64-hvm.xml \
> +          tests/xencapsdata/xen-ppc64.xml
>            tests/confdata/Makefile \
>            examples/domain-events/events-c/Makefile \
>            examples/hellolibvirt/Makefile)
> diff --git a/src/xen_internal.c b/src/xen_internal.c
> index cc5a8f9..31fdf5b 100644
> --- a/src/xen_internal.c
> +++ b/src/xen_internal.c
> @@ -2209,10 +2209,10 @@ xenHypervisorBuildCapabilities(virConnectPtr conn,
>                                               guest_archs[i].model,
>                                               guest_archs[i].bits,
>                                               (STREQ(hostmachine, "x86_64") ?
> -                                              "/usr/lib64/xen/bin/qemu-dm" :
> -                                              "/usr/lib/xen/bin/qemu-dm"),
> +                                              XEN_TOOLS64 "/bin/qemu-dm" :
> +                                              XEN_TOOLS "/bin/qemu-dm"),
>                                               (guest_archs[i].hvm ?
> -                                              "/usr/lib/xen/boot/hvmloader" :
> +                                              XEN_TOOLS "/boot/hvmloader" :
>                                                NULL),
>                                               1,
>                                               machines)) == NULL)
> diff --git a/tests/xencapsdata/Makefile.am b/tests/xencapsdata/Makefile.am
> index 7d77575..a59849b 100644
> --- a/tests/xencapsdata/Makefile.am
> +++ b/tests/xencapsdata/Makefile.am
> @@ -1,2 +1,2 @@
>  
> -EXTRA_DIST = $(wildcard *.xml) $(wildcard *.cpuinfo) $(wildcard *.caps)
> +EXTRA_DIST = $(wildcard *.xml.in) $(wildcard *.cpuinfo) $(wildcard *.caps)
> diff --git a/tests/xencapsdata/xen-i686-pae-hvm.xml b/tests/xencapsdata/xen-i686-pae-hvm.xml.in
> similarity index 84%
> rename from tests/xencapsdata/xen-i686-pae-hvm.xml
> rename to tests/xencapsdata/xen-i686-pae-hvm.xml.in
> index 42b099c..6a3a547 100644
> --- a/tests/xencapsdata/xen-i686-pae-hvm.xml
> +++ b/tests/xencapsdata/xen-i686-pae-hvm.xml.in
> @@ -19,7 +19,7 @@
>      <os_type>xen</os_type>
>      <arch name='i686'>
>        <wordsize>32</wordsize>
> -      <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
> +      <emulator>@XEN_TOOLS@/bin/qemu-dm</emulator>
>        <machine>xenpv</machine>
>        <domain type='xen'>
>        </domain>
> @@ -33,8 +33,8 @@
>      <os_type>hvm</os_type>
>      <arch name='i686'>
>        <wordsize>32</wordsize>
> -      <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
> -      <loader>/usr/lib/xen/boot/hvmloader</loader>
> +      <emulator>@XEN_TOOLS@/bin/qemu-dm</emulator>
> +      <loader>@XEN_TOOLS@/boot/hvmloader</loader>
>        <machine>xenfv</machine>
>        <domain type='xen'>
>        </domain>
> diff --git a/tests/xencapsdata/xen-i686-pae.xml b/tests/xencapsdata/xen-i686-pae.xml.in
> similarity index 91%
> rename from tests/xencapsdata/xen-i686-pae.xml
> rename to tests/xencapsdata/xen-i686-pae.xml.in
> index a6cec8a..e55b7d3 100644
> --- a/tests/xencapsdata/xen-i686-pae.xml
> +++ b/tests/xencapsdata/xen-i686-pae.xml.in
> @@ -19,7 +19,7 @@
>      <os_type>xen</os_type>
>      <arch name='i686'>
>        <wordsize>32</wordsize>
> -      <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
> +      <emulator>@XEN_TOOLS@/bin/qemu-dm</emulator>
>        <machine>xenpv</machine>
>        <domain type='xen'>
>        </domain>
> diff --git a/tests/xencapsdata/xen-i686.xml b/tests/xencapsdata/xen-i686.xml.in
> similarity index 90%
> rename from tests/xencapsdata/xen-i686.xml
> rename to tests/xencapsdata/xen-i686.xml.in
> index 9071212..56b5f01 100644
> --- a/tests/xencapsdata/xen-i686.xml
> +++ b/tests/xencapsdata/xen-i686.xml.in
> @@ -16,7 +16,7 @@
>      <os_type>xen</os_type>
>      <arch name='i686'>
>        <wordsize>32</wordsize>
> -      <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
> +      <emulator>@XEN_TOOLS@/bin/qemu-dm</emulator>
>        <machine>xenpv</machine>
>        <domain type='xen'>
>        </domain>
> diff --git a/tests/xencapsdata/xen-ia64-be-hvm.xml b/tests/xencapsdata/xen-ia64-be-hvm.xml.in
> similarity index 83%
> rename from tests/xencapsdata/xen-ia64-be-hvm.xml
> rename to tests/xencapsdata/xen-ia64-be-hvm.xml.in
> index 732b693..69e839e 100644
> --- a/tests/xencapsdata/xen-ia64-be-hvm.xml
> +++ b/tests/xencapsdata/xen-ia64-be-hvm.xml.in
> @@ -16,7 +16,7 @@
>      <os_type>xen</os_type>
>      <arch name='ia64'>
>        <wordsize>64</wordsize>
> -      <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
> +      <emulator>@XEN_TOOLS@/bin/qemu-dm</emulator>
>        <machine>xenpv</machine>
>        <domain type='xen'>
>        </domain>
> @@ -30,8 +30,8 @@
>      <os_type>hvm</os_type>
>      <arch name='ia64'>
>        <wordsize>64</wordsize>
> -      <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
> -      <loader>/usr/lib/xen/boot/hvmloader</loader>
> +      <emulator>@XEN_TOOLS@/bin/qemu-dm</emulator>
> +      <loader>@XEN_TOOLS@/boot/hvmloader</loader>
>        <machine>xenfv</machine>
>        <domain type='xen'>
>        </domain>
> diff --git a/tests/xencapsdata/xen-ia64-be.xml b/tests/xencapsdata/xen-ia64-be.xml.in
> similarity index 90%
> rename from tests/xencapsdata/xen-ia64-be.xml
> rename to tests/xencapsdata/xen-ia64-be.xml.in
> index 4f133ec..54c4684 100644
> --- a/tests/xencapsdata/xen-ia64-be.xml
> +++ b/tests/xencapsdata/xen-ia64-be.xml.in
> @@ -16,7 +16,7 @@
>      <os_type>xen</os_type>
>      <arch name='ia64'>
>        <wordsize>64</wordsize>
> -      <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
> +      <emulator>@XEN_TOOLS@/bin/qemu-dm</emulator>
>        <machine>xenpv</machine>
>        <domain type='xen'>
>        </domain>
> diff --git a/tests/xencapsdata/xen-ia64-hvm.xml b/tests/xencapsdata/xen-ia64-hvm.xml.in
> similarity index 82%
> rename from tests/xencapsdata/xen-ia64-hvm.xml
> rename to tests/xencapsdata/xen-ia64-hvm.xml.in
> index ef48a95..ede093c 100644
> --- a/tests/xencapsdata/xen-ia64-hvm.xml
> +++ b/tests/xencapsdata/xen-ia64-hvm.xml.in
> @@ -16,7 +16,7 @@
>      <os_type>xen</os_type>
>      <arch name='ia64'>
>        <wordsize>64</wordsize>
> -      <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
> +      <emulator>@XEN_TOOLS@/bin/qemu-dm</emulator>
>        <machine>xenpv</machine>
>        <domain type='xen'>
>        </domain>
> @@ -27,8 +27,8 @@
>      <os_type>hvm</os_type>
>      <arch name='ia64'>
>        <wordsize>64</wordsize>
> -      <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
> -      <loader>/usr/lib/xen/boot/hvmloader</loader>
> +      <emulator>@XEN_TOOLS@/bin/qemu-dm</emulator>
> +      <loader>@XEN_TOOLS@/boot/hvmloader</loader>
>        <machine>xenfv</machine>
>        <domain type='xen'>
>        </domain>
> diff --git a/tests/xencapsdata/xen-ia64.xml b/tests/xencapsdata/xen-ia64.xml.in
> similarity index 89%
> rename from tests/xencapsdata/xen-ia64.xml
> rename to tests/xencapsdata/xen-ia64.xml.in
> index 5570f4d..3407fd4 100644
> --- a/tests/xencapsdata/xen-ia64.xml
> +++ b/tests/xencapsdata/xen-ia64.xml.in
> @@ -16,7 +16,7 @@
>      <os_type>xen</os_type>
>      <arch name='ia64'>
>        <wordsize>64</wordsize>
> -      <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
> +      <emulator>@XEN_TOOLS@/bin/qemu-dm</emulator>
>        <machine>xenpv</machine>
>        <domain type='xen'>
>        </domain>
> diff --git a/tests/xencapsdata/xen-ppc64.xml b/tests/xencapsdata/xen-ppc64.xml.in
> similarity index 89%
> rename from tests/xencapsdata/xen-ppc64.xml
> rename to tests/xencapsdata/xen-ppc64.xml.in
> index 627d79c..8bb19b4 100644
> --- a/tests/xencapsdata/xen-ppc64.xml
> +++ b/tests/xencapsdata/xen-ppc64.xml.in
> @@ -16,7 +16,7 @@
>      <os_type>xen</os_type>
>      <arch name='ppc64'>
>        <wordsize>64</wordsize>
> -      <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
> +      <emulator>@XEN_TOOLS@/bin/qemu-dm</emulator>
>        <machine>xenpv</machine>
>        <domain type='xen'>
>        </domain>
> diff --git a/tests/xencapsdata/xen-x86_64-hvm.xml b/tests/xencapsdata/xen-x86_64-hvm.xml.in
> similarity index 80%
> rename from tests/xencapsdata/xen-x86_64-hvm.xml
> rename to tests/xencapsdata/xen-x86_64-hvm.xml.in
> index 52c12c6..47d49c1 100644
> --- a/tests/xencapsdata/xen-x86_64-hvm.xml
> +++ b/tests/xencapsdata/xen-x86_64-hvm.xml.in
> @@ -19,7 +19,7 @@
>      <os_type>xen</os_type>
>      <arch name='x86_64'>
>        <wordsize>64</wordsize>
> -      <emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
> +      <emulator>@XEN_TOOLS64@/bin/qemu-dm</emulator>
>        <machine>xenpv</machine>
>        <domain type='xen'>
>        </domain>
> @@ -30,8 +30,8 @@
>      <os_type>hvm</os_type>
>      <arch name='i686'>
>        <wordsize>32</wordsize>
> -      <emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
> -      <loader>/usr/lib/xen/boot/hvmloader</loader>
> +      <emulator>@XEN_TOOLS64@/bin/qemu-dm</emulator>
> +      <loader>@XEN_TOOLS@/boot/hvmloader</loader>
>        <machine>xenfv</machine>
>        <domain type='xen'>
>        </domain>
> @@ -48,8 +48,8 @@
>      <os_type>hvm</os_type>
>      <arch name='x86_64'>
>        <wordsize>64</wordsize>
> -      <emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
> -      <loader>/usr/lib/xen/boot/hvmloader</loader>
> +      <emulator>@XEN_TOOLS64@/bin/qemu-dm</emulator>
> +      <loader>@XEN_TOOLS@/boot/hvmloader</loader>
>        <machine>xenfv</machine>
>        <domain type='xen'>
>        </domain>
> diff --git a/tests/xencapsdata/xen-x86_64.xml b/tests/xencapsdata/xen-x86_64.xml.in
> similarity index 90%
> rename from tests/xencapsdata/xen-x86_64.xml
> rename to tests/xencapsdata/xen-x86_64.xml.in
> index 0faa43c..f275148 100644
> --- a/tests/xencapsdata/xen-x86_64.xml
> +++ b/tests/xencapsdata/xen-x86_64.xml.in
> @@ -19,7 +19,7 @@
>      <os_type>xen</os_type>
>      <arch name='x86_64'>
>        <wordsize>64</wordsize>
> -      <emulator>/usr/lib64/xen/bin/qemu-dm</emulator>
> +      <emulator>@XEN_TOOLS64@/bin/qemu-dm</emulator>
>        <machine>xenpv</machine>
>        <domain type='xen'>
>        </domain>
> -- 
> 1.6.3.3
> 

> --
> Libvir-list mailing list
> Libvir-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/libvir-list


-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]