Skip to contentSkip to conversation

ioemu: get rid of hardcoded paths

PATCH In review Christoph Egger 2 participants 2 messages Jun 26, 2009 – Jun 30, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ioemu: get rid of hardcoded paths

Hi!

Attached patches get rid of hardcoded pathes in ioemu and in ioemu-stubdom.

You need xen changeset 19841 or newer to have them working.

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
Makefile +5 -4
index c395e77..d5941c7 100644
@@ -46,10 +46,11 @@ $(filter %-user,$(SUBDIR_RULES)): libqemu_user.a
 
 recurse-all: $(SUBDIR_RULES)
 
-tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/libxc
-tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/blktap/lib
-tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/xenstore
-tapdisk-ioemu: CPPFLAGS += -I$(XEN_ROOT)/tools/include
+CPPFLAGS += -I$(XEN_ROOT)/tools/libxc
+CPPFLAGS += -I$(XEN_ROOT)/tools/blktap/lib
+CPPFLAGS += -I$(XEN_ROOT)/tools/xenstore
+CPPFLAGS += -I$(XEN_ROOT)/tools/include
+
 tapdisk-ioemu: tapdisk-ioemu.c cutils.c block.c block-raw.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c block-qcow2.c hw/xen_blktap.c osdep.c
 	$(CC) -DQEMU_TOOL $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ -lz $(LIBS)
 
xen-config-host.h +0 -3
index 5b1f4d7..f34e76b 100644
@@ -32,9 +32,6 @@ extern int xc_handle;
 extern int xen_pause_requested;
 extern int vcpus;
 
-#define DEFAULT_NETWORK_SCRIPT "/etc/xen/qemu-ifup"
-#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/xen/qemu-ifdown"
-
 #ifdef CONFIG_STUBDOM
 #define bdrv_host_device bdrv_raw
 #endif
xen-config.mak +1 -1
index 6210619..40984bc 100644
@@ -8,4 +8,4 @@ CONFIG_SOFTMMU=yes
 
 CFLAGS += -I$(QEMU_ROOT)/hw
 
-bindir = ${prefix}/${LIBLEAFDIR}/xen/bin
+bindir = ${LIBEXEC}
xen-hooks.mak +1 -1
index c6b4f8c..211416e 100644
@@ -78,4 +78,4 @@ datadir := $(subst qemu,xen/qemu,$(datadir))
 docdir :=  $(subst qemu,xen/qemu,$(docdir))
 mandir :=  $(subst share/man,share/xen/man,$(mandir))
 
-configdir := /etc/xen
+configdir := $(XEN_SCRIPT_DIR)
xen-setup +10 -1
index 8ca0019..fde1568 100755
@@ -9,7 +9,14 @@ rm -f config-host.mak
 
 if test -f config-host.h; then mv config-host.h config-host.h~; fi
 
-./configure --disable-gfx-check --disable-curses --disable-slirp "$@" --prefix=/usr
+if test -z "${PREFIX}"; then
+	PREFIX="/usr"
+fi
+if test -z "${XEN_SCRIPT_DIR}"; then
+	XEN_SCRIPT_DIR="/etc/xen/scripts"
+fi
+
+./configure --disable-gfx-check --disable-curses --disable-slirp "$@" --prefix=${PREFIX}
 
 target=i386-dm
 
@@ -22,6 +29,8 @@ ln -sf ../xen-config.mak $target/config.mak
 cat xen-config-host.mak >>config-host.mak
 
 sed -e 's,qemu,xen/qemu,' config-host.h >config-host.h.new
+echo "#define DEFAULT_NETWORK_SCRIPT      \"${XEN_SCRIPT_DIR}/qemu-ifup\"" >>config-host.h.new
+echo "#define DEFAULT_NETWORK_DOWN_SCRIPT \"${XEN_SCRIPT_DIR}/qemu-ifdown\"" >>config-host.h.new
 echo '#include "xen-config-host.h"' >>config-host.h.new
 
 if test -f config-host.h~; then mv config-host.h~ config-host.h; fi
xen-setup-stubdom +8 -6
index 835e505..fcf60c3 100755
@@ -21,7 +21,7 @@ TARGET_CPPFLAGS += $TARGET_CPPFLAGS -DCONFIG_STUBDOM -D__XEN_TOOLS__
 TARGET_CFLAGS= $TARGET_CFLAGS
 TARGET_LDFLAGS= $TARGET_LDFLAGS
 
-bindir = \${prefix}/\${LIBLEAFDIR}/xen/bin
+bindir = \${LIBEXEC}
 END
 mv -f $target/config.mak.new $target/config.mak
 #----------
@@ -31,7 +31,9 @@ ln -sf ../i386-dm/hookslib.mak $target/
 
 #----------
 cat <<END >config-host.h.new
-#define CONFIG_QEMU_SHAREDIR "/usr/share/xen/qemu"
+#define DEFAULT_NETWORK_SCRIPT "${XEN_SCRIPT_DIR}/qemu-ifup"
+#define DEFAULT_NETWORK_DOWN_SCRIPT "${XEN_SCRIPT_DIR}/qemu-ifdown"
+#define CONFIG_QEMU_SHAREDIR "${SHAREDIR}/xen/qemu"
 #define HOST_I386 1
 #define HOST_LONG_BITS 32
 #define HAVE_BYTESWAP_H 1
@@ -46,11 +48,11 @@ mv -f config-host.h.new config-host.h
 #----------
 cat <<END >config-host.mak.new
 CONFIG_STUBDOM=yes
-prefix=/usr
+prefix=$(PREFIX)
 bindir=\${prefix}/bin
-mandir=\${prefix}/share/man
-datadir=\${prefix}/share/qemu
-docdir=\${prefix}/share/doc/qemu
+mandir=\$(MANDIR)
+datadir=\$(SHAREDIR)/qemu
+docdir=\$(SHAREDIR)/doc/qemu
 MAKE=make
 INSTALL=install
 CC=gcc

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

Christoph Egger writes ("[PATCH] ioemu: get rid of hardcoded paths"):

Quoted 2 lines

Attached patches get rid of hardcoded pathes in ioemu and in ioemu-stubdom.

I have applied this patch. However, you really ought to have mentioned that it moves /etc/xen/qemu-ifup to /etc/xen/scripts! Did you notice this ?

I agree that the move is good, but this change may cause people trouble when they upgrade so it should be mentioned in the release notes. I'm not sure where the draft release notes for 3.5 are kept.

Ian.