All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC] libxl: fix paths in capability string
@ 2015-01-06 16:12 Wei Liu
  0 siblings, 0 replies; 13+ messages in thread
From: Wei Liu @ 2015-01-06 16:12 UTC (permalink / raw)
  To: libvir-list; +Cc: jfehlig, Wei Liu, xen-devel

Currently libxl driver hardcodes some paths in its capability string,
which might not be the correct paths.

This patch introduces --with-libxl-prefix, so that user can specify the
prefix used to build Xen tools. The default value is /usr/local which is
the default --prefix for Xen tools.

Change emualtor from qemu-dm to qemu-system-i386 because libxl (in Xen)
use this as the default emulator.

No need to check hostarch to determine whether to use lib or lib64
anymore because we now always use lib.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
This patch is RFC because I introduce --with-libxl-prefix and I don't know
whether it's acceptable.

Right now libvirt's driver doesn't seem to use these default paths so
everything just works. But it would be nice for libvirt to report the
correct paths instead of hardcoded (and possibly wrong) ones.
---
 configure.ac           |    4 ++++
 src/libxl/libxl_conf.c |    6 ++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 167b875..8d10361 100644
--- a/configure.ac
+++ b/configure.ac
@@ -533,6 +533,9 @@ AC_ARG_WITH([libxl],
   [AS_HELP_STRING([--with-libxl],
     [add libxenlight support @<:@default=check@:>@])])
 m4_divert_text([DEFAULTS], [with_libxl=check])
+AC_ARG_WITH([libxl-prefix], [AS_HELP_STRING([--with-libxl-prefix=path],
+            [prefix used to build libxl, default /usr/local])],
+            [LIBXL_PREFIX=$withval], [LIBXL_PREFIX="/usr/local"])
 AC_ARG_WITH([vbox],
   [AS_HELP_STRING([--with-vbox=@<:@PFX@:>@],
     [VirtualBox XPCOMC location @<:@default=yes@:>@])])
@@ -893,6 +896,7 @@ fi
 
 if test "$with_libxl" = "yes"; then
     AC_DEFINE_UNQUOTED([WITH_LIBXL], 1, [whether libxenlight driver is enabled])
+    AC_DEFINE_UNQUOTED([LIBXL_PREFIX], ["$LIBXL_PREFIX"], [libxl prefix])
 fi
 AM_CONDITIONAL([WITH_LIBXL], [test "$with_libxl" = "yes"])
 
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 0555b91..fbb4e29 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -428,11 +428,9 @@ libxlCapsInitGuests(libxl_ctx *ctx, virCapsPtr caps)
         if ((guest = virCapabilitiesAddGuest(caps,
                                              guest_archs[i].hvm ? "hvm" : "xen",
                                              guest_archs[i].arch,
-                                             ((hostarch == VIR_ARCH_X86_64) ?
-                                              "/usr/lib64/xen/bin/qemu-dm" :
-                                              "/usr/lib/xen/bin/qemu-dm"),
+                                             LIBXL_PREFIX "/lib/xen/bin/qemu-system-i386",
                                              (guest_archs[i].hvm ?
-                                              "/usr/lib/xen/boot/hvmloader" :
+                                              LIBXL_PREFIX "/lib/xen/boot/hvmloader" :
                                               NULL),
                                              1,
                                              machines)) == NULL) {
-- 
1.7.10.4

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

end of thread, other threads:[~2015-01-07 22:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1420560738-11007-1-git-send-email-wei.liu2@citrix.com>
2015-01-06 16:50 ` [PATCH RFC] libxl: fix paths in capability string Frediano Ziglio
2015-01-06 17:18   ` Wei Liu
2015-01-06 17:03 ` Ian Campbell
2015-01-06 17:12   ` Andrew Cooper
2015-01-06 17:20   ` Wei Liu
     [not found]   ` <20150106172054.GG28680@zion.uk.xensource.com>
2015-01-06 17:27     ` Ian Campbell
2015-01-06 17:28 ` [libvirt] " Eric Blake
     [not found] ` <54AC1B2D.3090000@redhat.com>
2015-01-06 17:36   ` Daniel P. Berrange
2015-01-07 11:55   ` Wei Liu
     [not found]   ` <20150106173657.GI16888@redhat.com>
2015-01-07 11:56     ` Wei Liu
2015-01-07 11:57 ` Wei Liu
     [not found] ` <20150107115757.GK28680@zion.uk.xensource.com>
2015-01-07 22:04   ` Jim Fehlig
2015-01-06 16:12 Wei Liu

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.