All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] add ./configure --confsuffix option (v2)
@ 2012-03-20 20:15 Eduardo Habkost
  2012-03-20 20:15 ` [Qemu-devel] [PATCH 1/3] Makefile: use $(confdir) instead of hardcoding $(sysconfdir)/qemu Eduardo Habkost
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Eduardo Habkost @ 2012-03-20 20:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Anthony Liguori

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(-)

-- 
1.7.3.2

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

* [Qemu-devel] [PATCH 1/3] Makefile: use $(confdir) instead of hardcoding $(sysconfdir)/qemu
  2012-03-20 20:15 [Qemu-devel] [PATCH 0/3] add ./configure --confsuffix option (v2) Eduardo Habkost
@ 2012-03-20 20:15 ` Eduardo Habkost
  2012-03-21 12:40   ` Paolo Bonzini
  2012-03-20 20:15 ` [Qemu-devel] [PATCH 2/3] qemu-options.hx: refer to confdir instead of sysconfdir on docs Eduardo Habkost
  2012-03-20 20:15 ` [Qemu-devel] [PATCH 3/3] configure: add --confsuffix option Eduardo Habkost
  2 siblings, 1 reply; 11+ messages in thread
From: Eduardo Habkost @ 2012-03-20 20:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Anthony Liguori

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 1bc3cb0..9d583c4 100644
--- a/Makefile
+++ b/Makefile
@@ -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)"
-- 
1.7.3.2

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

* [Qemu-devel] [PATCH 2/3] qemu-options.hx: refer to confdir instead of sysconfdir on docs
  2012-03-20 20:15 [Qemu-devel] [PATCH 0/3] add ./configure --confsuffix option (v2) Eduardo Habkost
  2012-03-20 20:15 ` [Qemu-devel] [PATCH 1/3] Makefile: use $(confdir) instead of hardcoding $(sysconfdir)/qemu Eduardo Habkost
@ 2012-03-20 20:15 ` Eduardo Habkost
  2012-03-21 12:43   ` Paolo Bonzini
  2012-03-20 20:15 ` [Qemu-devel] [PATCH 3/3] configure: add --confsuffix option Eduardo Habkost
  2 siblings, 1 reply; 11+ messages in thread
From: Eduardo Habkost @ 2012-03-20 20:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Anthony Liguori

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 <ehabkost@redhat.com>
---
 qemu-options.hx |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index daefce3..39578f1 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -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,
-- 
1.7.3.2

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

* [Qemu-devel] [PATCH 3/3] configure: add --confsuffix option
  2012-03-20 20:15 [Qemu-devel] [PATCH 0/3] add ./configure --confsuffix option (v2) Eduardo Habkost
  2012-03-20 20:15 ` [Qemu-devel] [PATCH 1/3] Makefile: use $(confdir) instead of hardcoding $(sysconfdir)/qemu Eduardo Habkost
  2012-03-20 20:15 ` [Qemu-devel] [PATCH 2/3] qemu-options.hx: refer to confdir instead of sysconfdir on docs Eduardo Habkost
@ 2012-03-20 20:15 ` Eduardo Habkost
  2012-03-21 12:39   ` Paolo Bonzini
  2 siblings, 1 reply; 11+ messages in thread
From: Eduardo Habkost @ 2012-03-20 20:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Anthony Liguori

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.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 configure |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 8b4e3c1..1170466 100755
--- a/configure
+++ b/configure
@@ -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"
-- 
1.7.3.2

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

* Re: [Qemu-devel] [PATCH 3/3] configure: add --confsuffix option
  2012-03-20 20:15 ` [Qemu-devel] [PATCH 3/3] configure: add --confsuffix option Eduardo Habkost
@ 2012-03-21 12:39   ` Paolo Bonzini
  2012-03-21 14:42     ` Eduardo Habkost
  0 siblings, 1 reply; 11+ messages in thread
From: Paolo Bonzini @ 2012-03-21 12:39 UTC (permalink / raw)
  To: Eduardo Habkost; +Cc: qemu-devel, Anthony Liguori

Il 20/03/2012 21:15, Eduardo Habkost ha scritto:
> 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

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

* Re: [Qemu-devel] [PATCH 1/3] Makefile: use $(confdir) instead of hardcoding $(sysconfdir)/qemu
  2012-03-20 20:15 ` [Qemu-devel] [PATCH 1/3] Makefile: use $(confdir) instead of hardcoding $(sysconfdir)/qemu Eduardo Habkost
@ 2012-03-21 12:40   ` Paolo Bonzini
  0 siblings, 0 replies; 11+ messages in thread
From: Paolo Bonzini @ 2012-03-21 12:40 UTC (permalink / raw)
  To: Eduardo Habkost; +Cc: qemu-devel, Anthony Liguori

Il 20/03/2012 21:15, Eduardo Habkost ha scritto:
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>  Makefile |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 1bc3cb0..9d583c4 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -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)"

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

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

* Re: [Qemu-devel] [PATCH 2/3] qemu-options.hx: refer to confdir instead of sysconfdir on docs
  2012-03-20 20:15 ` [Qemu-devel] [PATCH 2/3] qemu-options.hx: refer to confdir instead of sysconfdir on docs Eduardo Habkost
@ 2012-03-21 12:43   ` Paolo Bonzini
  2012-03-21 13:27     ` Eduardo Habkost
  0 siblings, 1 reply; 11+ messages in thread
From: Paolo Bonzini @ 2012-03-21 12:43 UTC (permalink / raw)
  To: Eduardo Habkost; +Cc: qemu-devel, Anthony Liguori

Il 20/03/2012 21:15, Eduardo Habkost ha scritto:
> 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 <ehabkost@redhat.com>
> ---
>  qemu-options.hx |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/qemu-options.hx b/qemu-options.hx
> index daefce3..39578f1 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -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

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

* Re: [Qemu-devel] [PATCH 2/3] qemu-options.hx: refer to confdir instead of sysconfdir on docs
  2012-03-21 12:43   ` Paolo Bonzini
@ 2012-03-21 13:27     ` Eduardo Habkost
  0 siblings, 0 replies; 11+ messages in thread
From: Eduardo Habkost @ 2012-03-21 13:27 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, Anthony Liguori

On Wed, Mar 21, 2012 at 01:43:58PM +0100, Paolo Bonzini wrote:
> Il 20/03/2012 21:15, Eduardo Habkost ha scritto:
> > 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 <ehabkost@redhat.com>
> > ---
> >  qemu-options.hx |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/qemu-options.hx b/qemu-options.hx
> > index daefce3..39578f1 100644
> > --- a/qemu-options.hx
> > +++ b/qemu-options.hx
> > @@ -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?

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?).

-- 
Eduardo

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

* Re: [Qemu-devel] [PATCH 3/3] configure: add --confsuffix option
  2012-03-21 12:39   ` Paolo Bonzini
@ 2012-03-21 14:42     ` Eduardo Habkost
  2012-03-21 22:23       ` Paolo Bonzini
  0 siblings, 1 reply; 11+ messages in thread
From: Eduardo Habkost @ 2012-03-21 14:42 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, Anthony Liguori

On Wed, Mar 21, 2012 at 01:39:39PM +0100, Paolo Bonzini wrote:
> Il 20/03/2012 21:15, Eduardo Habkost ha scritto:
> > 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

-- 
Eduardo

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

* Re: [Qemu-devel] [PATCH 3/3] configure: add --confsuffix option
  2012-03-21 14:42     ` Eduardo Habkost
@ 2012-03-21 22:23       ` Paolo Bonzini
  2012-03-22 12:54         ` Eduardo Habkost
  0 siblings, 1 reply; 11+ messages in thread
From: Paolo Bonzini @ 2012-03-21 22:23 UTC (permalink / raw)
  To: Eduardo Habkost; +Cc: qemu-devel, Anthony Liguori

Il 21/03/2012 15:42, Eduardo Habkost ha scritto:
> On Wed, Mar 21, 2012 at 01:39:39PM +0100, Paolo Bonzini wrote:
>> Il 20/03/2012 21:15, Eduardo Habkost ha scritto:
>>> 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

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

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

* Re: [Qemu-devel] [PATCH 3/3] configure: add --confsuffix option
  2012-03-21 22:23       ` Paolo Bonzini
@ 2012-03-22 12:54         ` Eduardo Habkost
  0 siblings, 0 replies; 11+ messages in thread
From: Eduardo Habkost @ 2012-03-22 12:54 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, Anthony Liguori

On Wed, Mar 21, 2012 at 11:23:00PM +0100, Paolo Bonzini wrote:
> Il 21/03/2012 15:42, Eduardo Habkost ha scritto:
> > 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.

Excellent. I'll do it.

-- 
Eduardo

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

end of thread, other threads:[~2012-03-22 12:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-20 20:15 [Qemu-devel] [PATCH 0/3] add ./configure --confsuffix option (v2) Eduardo Habkost
2012-03-20 20:15 ` [Qemu-devel] [PATCH 1/3] Makefile: use $(confdir) instead of hardcoding $(sysconfdir)/qemu Eduardo Habkost
2012-03-21 12:40   ` Paolo Bonzini
2012-03-20 20:15 ` [Qemu-devel] [PATCH 2/3] qemu-options.hx: refer to confdir instead of sysconfdir on docs Eduardo Habkost
2012-03-21 12:43   ` Paolo Bonzini
2012-03-21 13:27     ` Eduardo Habkost
2012-03-20 20:15 ` [Qemu-devel] [PATCH 3/3] configure: add --confsuffix option Eduardo Habkost
2012-03-21 12:39   ` Paolo Bonzini
2012-03-21 14:42     ` Eduardo Habkost
2012-03-21 22:23       ` Paolo Bonzini
2012-03-22 12:54         ` Eduardo Habkost

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.