add ./configure --confsuffix option (v2)
cover add ./configure --confsuffix option (v2)
This is a new try to make the full configuration path configurable.
As the approach using --confdir was rejected because the "package name" is something immutable, this adds a option where we can ask Qemu to use a directory name that is not equal to the package name.
Eduardo Habkost (3):
Makefile: use $(confdir) instead of hardcoding $(sysconfdir)/qemu qemu-options.hx: refer to confdir instead of sysconfdir on docs
configure: add --confsuffix option
Makefile | 4 ++-- configure | 7 +++++-- qemu-options.hx | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-)
Signature · 1 line
1.7.3.2
PATCH 1/3 Makefile: use $(confdir) instead of hardcoding $(sysconfdir)/qemu
--- Makefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
@@ -279,8 +279,8 @@ ifdef CONFIG_VIRTFS $(INSTALL_DATA) fsdev/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1" endif install-sysconfig: - $(INSTALL_DIR) "$(DESTDIR)$(sysconfdir)/qemu" - $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(sysconfdir)/qemu" + $(INSTALL_DIR) "$(DESTDIR)$(confdir)" + $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(confdir)" install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig $(INSTALL_DIR) "$(DESTDIR)$(bindir)"
Signature · 1 line
1.7.3.2
Re: [Qemu-devel] [PATCH 1/3] Makefile: use $(confdir) instead of hardcoding $(sysconfdir)/qemu
Il 20/03/2012 21:15, Eduardo Habkost ha scritto:
Quoted 10 lines
Signed-off-by Eduardo Habkost <[email protected]>--- Makefile | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)Makefile +0
-0
Makefile ifdef CONFIG_VIRTFS · line 286
Quoted 10 lines
Makefile +2
-2@@ -279,8 +279,8 @@ ifdef CONFIG_VIRTFS $(INSTALL_DATA) fsdev/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1" endif install-sysconfig: - $(INSTALL_DIR) "$(DESTDIR)$(sysconfdir)/qemu" - $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(sysconfdir)/qemu" + $(INSTALL_DIR) "$(DESTDIR)$(confdir)" + $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(confdir)" install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig $(INSTALL_DIR) "$(DESTDIR)$(bindir)"
PATCH 2/3 qemu-options.hx: refer to confdir instead of sysconfdir on docs
In reply to Eduardo HabkostThe current docs are wrong: ${sysconfdir} is (by default) /etc, ${confdir} is (by default) /etc/qemu, that's where the config files are stored.
--- qemu-options.hx | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
qemu-options.hx +2 -2
@@ -2676,8 +2676,8 @@ DEF("nodefconfig", 0, QEMU_OPTION_nodefconfig, STEXI @item -nodefconfig @findex -nodefconfig -Normally QEMU loads a configuration file from @var{sysconfdir}/qemu.conf and -@var{sysconfdir}/target-@var{ARCH}.conf on startup. The @code{-nodefconfig} +Normally QEMU loads a configuration file from @var{confdir}/qemu.conf and +@var{confdir}/target-@var{ARCH}.conf on startup. The @code{-nodefconfig} option will prevent QEMU from loading these configuration files at startup. ETEXI DEF("trace", HAS_ARG, QEMU_OPTION_trace,
Signature · 1 line
1.7.3.2
Re: [Qemu-devel] [PATCH 2/3] qemu-options.hx: refer to confdir instead of sysconfdir on docs
Il 20/03/2012 21:15, Eduardo Habkost ha scritto:
Quoted 14 lines
The current docs are wrong: ${sysconfdir} is (by default) /etc, ${confdir} is (by default)
/etc/qemu, that's where the config files are stored.Signed-off-by Eduardo Habkost <[email protected]>--- qemu-options.hx | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)qemu-options.hx +0
-0
qemu-options.hx DEF("nodefconfig", 0, QEMU_OPTION_nodefconfig, · line 2683
Quoted 10 lines
qemu-options.hx +2
-2@@ -2676,8 +2676,8 @@ DEF("nodefconfig", 0, QEMU_OPTION_nodefconfig, STEXI @item -nodefconfig @findex -nodefconfig -Normally QEMU loads a configuration file from @var{sysconfdir}/qemu.conf and -@var{sysconfdir}/target-@var{ARCH}.conf on startup. The @code{-nodefconfig} +Normally QEMU loads a configuration file from @var{confdir}/qemu.conf and +@var{confdir}/target-@var{ARCH}.conf on startup. The @code{-nodefconfig} option will prevent QEMU from loading these configuration files at startup. ETEXI DEF("trace", HAS_ARG, QEMU_OPTION_trace,
There's no definition of confdir and sysconfdir in the documentation. Perhaps writing @var{sysconfdir}/qemu/qemu.conf is better for now?
Paolo
Re: [Qemu-devel] [PATCH 2/3] qemu-options.hx: refer to confdir instead of sysconfdir on docs
Quoted 20 lines · Paolo Bonzini
Il 20/03/2012 21:15, Eduardo Habkost ha scritto:
Quoted 19 lines
The current docs are wrong: ${sysconfdir} is (by default) /etc, ${confdir} is (by default)
/etc/qemu, that's where the config files are stored.Signed-off-by Eduardo Habkost <[email protected]>--- qemu-options.hx | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)qemu-options.hx +0
-2@@ -2676,8 +2676,8 @@ DEF("nodefconfig", 0, QEMU_OPTION_nodefconfig, STEXI @item -nodefconfig @findex -nodefconfig -Normally QEMU loads a configuration file from @var{sysconfdir}/qemu.conf and -@var{sysconfdir}/target-@var{ARCH}.conf on startup. The @code{-nodefconfig}
Quoted 8 lines
qemu-options.hx DEF("nodefconfig", 0, QEMU_OPTION_nodefconfig, · line 2683
Quoted 5 lines
qemu-options.hx +2
-0+Normally QEMU loads a configuration file from @var{confdir}/qemu.conf and +@var{confdir}/target-@var{ARCH}.conf on startup. The @code{-nodefconfig} option will prevent QEMU from loading these configuration files at startup. ETEXI DEF("trace", HAS_ARG, QEMU_OPTION_trace,There's no definition of confdir and sysconfdir in the documentation. Perhaps writing
@var{sysconfdir}/qemu/qemu.confis better for now?
Maybe it would be better, yes, as it gives a better hint for the user of where the config directory may be.
But it's still not very clear for the user. Is it possible to expand build-time config variables inside the documentation so they show the full path? I have zero knowledge about texinfo, and even less about the texinfo conversion scripts Qemu uses (do they support the full texinfo language, or just a subset of it?).
Signature · 1 line
Eduardo
PATCH 3/3 configure: add --confsuffix option
In reply to Eduardo HabkostThis way we can choose a configuration file path different from ${sysconfdir}/PACKAGE.
This also changes the configure output to show the full configuration dir path (including $confsuffix), instead of just $sysconfdir.
--- configure | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)
configure +5 -2
@@ -595,6 +595,8 @@ for opt do ;; --sysconfdir=*) sysconfdir="$optarg" ;; + --confsuffix=*) confsuffix="$optarg" + ;; --sbindir=*|--libexecdir=*|--sharedstatedir=*|--localstatedir=*|\ --oldincludedir=*|--datarootdir=*|--infodir=*|--localedir=*|\ --htmldir=*|--dvidir=*|--pdfdir=*|--psdir=*)
@@ -1010,7 +1012,8 @@ echo " --mandir=PATH install man pages in PATH" echo " --datadir=PATH install firmware in PATH" echo " --docdir=PATH install documentation in PATH" echo " --bindir=PATH install binaries in PATH" -echo " --sysconfdir=PATH install config in PATH/qemu" +echo " --sysconfdir=PATH install config in PATH$confsuffix" +echo " --confsuffix=SUFFIX install config in \${sysconfdir}SUFFIX [$confsuffix]" echo " --enable-debug-tcg enable TCG debugging" echo " --disable-debug-tcg disable TCG debugging (default)" echo " --enable-debug enable common debug build options"
@@ -2869,7 +2872,7 @@ echo "BIOS directory `eval echo $datadir`" echo "binary directory `eval echo $bindir`" echo "library directory `eval echo $libdir`" echo "include directory `eval echo $includedir`" -echo "config directory `eval echo $sysconfdir`" +echo "config directory `eval echo $confdir`" if test "$mingw32" = "no" ; then echo "Manual directory `eval echo $mandir`" echo "ELF interp prefix $interp_prefix"
Signature · 1 line
1.7.3.2
Re: [Qemu-devel] [PATCH 3/3] configure: add --confsuffix option
Il 20/03/2012 21:15, Eduardo Habkost ha scritto:
Quoted 5 lines
This way we can choose a configuration file path different from ${sysconfdir}/PACKAGE.
This also changes the configure output to show the full configuration dir path (including $confsuffix), instead of just $sysconfdir.
Can you please apply this to datadir too? (i.e. set the datadir default to just $prefix/share, and later add $confsuffix).
Paolo
Re: [Qemu-devel] [PATCH 3/3] configure: add --confsuffix option
Quoted 9 lines · Paolo Bonzini
Il 20/03/2012 21:15, Eduardo Habkost ha scritto:
Quoted 5 lines
This way we can choose a configuration file path different from ${sysconfdir}/PACKAGE.
This also changes the configure output to show the full configuration dir path (including $confsuffix), instead of just $sysconfdir.
Can you please apply this to datadir too? (i.e. set the datadir default to just $prefix/share, and later add $confsuffix).
I will do it, and send v3 of the series.
I guess we don't want to change the meaning of
'./configure --datadir=PATH' (that currently expects the full path), to keep compatibility, right?
To make sure the expected semantics are clear:
This is straightforward:
./configure
qemu data dir: /usr/share/qemu
qemu conf dir: /etc/qemu
For this one, we would have compatibility issues to take care of:
./configure --datadir=FOO --sysconfdir=SYS
qemu data dir: FOO
(it would be better if it was FOO/qemu, but needed for compatibility)
qemu conf dir: SYS/qemu
On the following cases, I don't know what would be the best behavior:
./configure --datadir=FOO --confsuffix=/BAR
qemu data dir: FOO/BAR
(maybe it should be just FOO, to keep the rules easier to understand?)
qemu conf dir: /etc/BAR
./configure --datadir=FOO --confsuffix=/BAR --sysconfdir=SYS
qemu data dir: FOO/BAR
(maybe it should be just FOO, to keep the rules easier to understand?)
qemu conf dir: SYS/BAR
Signature · 1 line
Eduardo
Re: [Qemu-devel] [PATCH 3/3] configure: add --confsuffix option
Il 21/03/2012 15:42, Eduardo Habkost ha scritto:
Quoted 27 lines · Paolo Bonzini
Quoted 9 lines
Il 20/03/2012 21:15, Eduardo Habkost ha scritto:
Quoted 5 lines
This way we can choose a configuration file path different from ${sysconfdir}/PACKAGE.
This also changes the configure output to show the full configuration dir path (including $confsuffix), instead of just $sysconfdir.
Can you please apply this to datadir too? (i.e. set the datadir default to just $prefix/share, and later add $confsuffix).
I will do it, and send v3 of the series.
I guess we don't want to change the meaning of
'./configure --datadir=PATH' (that currently expects the full path), to keep compatibility, right?To make sure the expected semantics are clear:
This is straightforward:
./configure
qemu data dir:/usr/share/qemu
qemu conf dir:/etc/qemu
Quoted 6 lines
For this one, we would have compatibility issues to take care of:
./configure --datadir=FOO --sysconfdir=SYS
qemu data dir: FOO
(it would be better if it was FOO/qemu, but needed for compatibility)
qemu conf dir: SYS/qemu
Hmm, perhaps we can break it... I checked Fedora, Debian
(http://cdn.debian.net/debian/pool/main/q/qemu/qemu_1.0.1+dfsg-1.debian.tar.gz),
Arch Linux
(http://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/qemu),
Gentoo
(http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/app-emulation/qemu-kvm/qemu-kvm-0.15.1-r1.ebuild?view=markup),
FreeBSD
(http://www.freebsd.org/cgi/cvsweb.cgi/ports/emulators/qemu/Makefile?rev=1.122;content-type=text%2Fplain)
and none of them use it.
And since we are at it, let's call the option --with-confsuffix so it is a bit more autoconfy.
Paolo
Re: [Qemu-devel] [PATCH 3/3] configure: add --confsuffix option
Quoted 18 lines · Paolo Bonzini
Il 21/03/2012 15:42, Eduardo Habkost ha scritto:
Quoted 6 lines
For this one, we would have compatibility issues to take care of:
./configure --datadir=FOO --sysconfdir=SYS
qemu data dir: FOO
(it would be better if it was FOO/qemu, but needed for compatibility)
qemu conf dir: SYS/qemuHmm, perhaps we can break it... I checked Fedora, Debian
(http://cdn.debian.net/debian/pool/main/q/qemu/qemu_1.0.1+dfsg-1.debian.tar.gz),
Arch Linux
(http://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/qemu),
Gentoo
(http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/app-emulation/qemu-kvm/qemu-kvm-0.15.1-r1.ebuild?view=markup),
FreeBSD
(http://www.freebsd.org/cgi/cvsweb.cgi/ports/emulators/qemu/Makefile?rev=1.122;content-type=text%2Fplain)
and none of them use it.
Quoted 2 lines
And since we are at it, let's call the option --with-confsuffix so it is a bit more autoconfy.
Excellent. I'll do it.
Signature · 1 line
Eduardo