All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/4] Introduce global config (v3)
@ 2010-01-24 14:22 Anthony Liguori
  2010-01-24 14:22 ` [Qemu-devel] [PATCH 1/3] Support --sysconfdir in configure to specify path to configuration files (v3) Anthony Liguori
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Anthony Liguori @ 2010-01-24 14:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Cooper, Paolo Bonzini, Anthony Liguori, Gerd Hoffman

This series introduces global config files stored in /etc/qemu.  There is both
a common config (qemu.conf) and a per-target config (target-<TARGET_NAME>.conf).

I've removed the default device bits from the series as it requires some more
thought on how to best integrate it.  That makes this series rather simple.

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

* [Qemu-devel] [PATCH 1/3] Support --sysconfdir in configure to specify path to configuration files (v3)
  2010-01-24 14:22 [Qemu-devel] [PATCH 0/4] Introduce global config (v3) Anthony Liguori
@ 2010-01-24 14:22 ` Anthony Liguori
  2010-01-24 14:45   ` [Qemu-devel] " Paolo Bonzini
  2010-01-24 14:22 ` [Qemu-devel] [PATCH 2/3] Move out option lookup into a separate function Anthony Liguori
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 18+ messages in thread
From: Anthony Liguori @ 2010-01-24 14:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori

The default value is ${prefix}/etc/qemu.  --sysconfdir can be used to override
the default to an absolute path.  The expectation is that when installed to
/usr, --sysconfdir=/etc/qemu will be used.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
v2 -> v3
 - default sysconfdir to ${prefix}/etc on unix, ${prefix} on win32
 - set confdir to ${sysconfdir}/qemu on unix, ${sysconfdir} on win32
v1 -> v2
 - rename to sysconf
---
 configure |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 5631bbb..379b536 100755
--- a/configure
+++ b/configure
@@ -32,6 +32,7 @@ cpu=""
 prefix=""
 interp_prefix="/usr/gnemul/qemu-%M"
 static="no"
+sysconfdir=""
 sparc_cpu=""
 cross_prefix=""
 cc="gcc"
@@ -453,6 +454,8 @@ for opt do
   ;;
   --static) static="yes"
   ;;
+  --sysconfdir) sysconfdir="$optarg"
+  ;;
   --disable-sdl) sdl="no"
   ;;
   --enable-sdl) sdl="yes"
@@ -686,6 +689,7 @@ echo "  --extra-ldflags=LDFLAGS  append extra linker flags LDFLAGS"
 echo "  --make=MAKE              use specified make [$make]"
 echo "  --install=INSTALL        use specified install [$install]"
 echo "  --static                 enable static build [$static]"
+echo "  --sysconfdir=PATH        install config in PATH"
 echo "  --enable-debug-tcg       enable TCG debugging"
 echo "  --disable-debug-tcg      disable TCG debugging (default)"
 echo "  --enable-debug           enable common debug build options"
@@ -1828,8 +1832,12 @@ if test "$mingw32" = "yes" ; then
   fi
   mansuffix=""
   datasuffix=""
+  confsuffix=""
   docsuffix=""
   binsuffix=""
+  if test -z "$sysconfdir" ; then
+      sysconfdir="${prefix}"
+  fi
 else
   if test -z "$prefix" ; then
       prefix="/usr/local"
@@ -1838,6 +1846,9 @@ else
   datasuffix="/share/qemu"
   docsuffix="/share/doc/qemu"
   binsuffix="/bin"
+  if test -z "$sysconfdir" ; then
+      sysconfdir="${prefix}/etc"
+  fi
 fi
 
 echo "Install prefix    $prefix"
@@ -1914,6 +1925,11 @@ printf " '%s'" "$0" "$@" >> $config_host_mak
 echo >> $config_host_mak
 
 echo "CONFIG_QEMU_SHAREDIR=\"$prefix$datasuffix\"" >> $config_host_mak
+if test "$mingw32" = "yes" ; then
+  echo "CONFIG_QEMU_CONFDIR=\"$sysconfdir\"" >> $config_host_mak
+else
+  echo "CONFIG_QEMU_CONFDIR=\"${sysconfdir}/qemu\"" >> $config_host_mak
+fi
 
 case "$cpu" in
   i386|x86_64|alpha|cris|hppa|ia64|m68k|microblaze|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64)
@@ -2159,6 +2175,7 @@ echo "prefix=$prefix" >> $config_host_mak
 echo "bindir=\${prefix}$binsuffix" >> $config_host_mak
 echo "mandir=\${prefix}$mansuffix" >> $config_host_mak
 echo "datadir=\${prefix}$datasuffix" >> $config_host_mak
+echo "sysconfdir=$sysconfdir" >> $config_host_mak
 echo "docdir=\${prefix}$docsuffix" >> $config_host_mak
 echo "MAKE=$make" >> $config_host_mak
 echo "INSTALL=$install" >> $config_host_mak
-- 
1.6.5.2

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

* [Qemu-devel] [PATCH 2/3] Move out option lookup into a separate function
  2010-01-24 14:22 [Qemu-devel] [PATCH 0/4] Introduce global config (v3) Anthony Liguori
  2010-01-24 14:22 ` [Qemu-devel] [PATCH 1/3] Support --sysconfdir in configure to specify path to configuration files (v3) Anthony Liguori
@ 2010-01-24 14:22 ` Anthony Liguori
  2010-01-24 14:22 ` [Qemu-devel] [PATCH 3/3] Load global config files by default (v3) Anthony Liguori
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 18+ messages in thread
From: Anthony Liguori @ 2010-01-24 14:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
 vl.c |   72 +++++++++++++++++++++++++++++++++++++++--------------------------
 1 files changed, 43 insertions(+), 29 deletions(-)

diff --git a/vl.c b/vl.c
index e070ec9..e00ae0d 100644
--- a/vl.c
+++ b/vl.c
@@ -4658,6 +4658,46 @@ static int debugcon_parse(const char *devname)
     return 0;
 }
 
+static const QEMUOption *lookup_opt(int argc, char **argv,
+                                    const char **poptarg, int *poptind)
+{
+    const QEMUOption *popt;
+    int optind = *poptind;
+    char *r = argv[optind];
+    const char *optarg;
+
+    optind++;
+    /* Treat --foo the same as -foo.  */
+    if (r[1] == '-')
+        r++;
+    popt = qemu_options;
+    for(;;) {
+        if (!popt->name) {
+            fprintf(stderr, "%s: invalid option -- '%s'\n",
+                    argv[0], r);
+            exit(1);
+        }
+        if (!strcmp(popt->name, r + 1))
+            break;
+        popt++;
+    }
+    if (popt->flags & HAS_ARG) {
+        if (optind >= argc) {
+            fprintf(stderr, "%s: option '%s' requires an argument\n",
+                    argv[0], r);
+            exit(1);
+        }
+        optarg = argv[optind++];
+    } else {
+        optarg = NULL;
+    }
+
+    *poptarg = optarg;
+    *poptind = optind;
+
+    return popt;
+}
+
 int main(int argc, char **argv, char **envp)
 {
     const char *gdbstub_dev = NULL;
@@ -4672,7 +4712,7 @@ int main(int argc, char **argv, char **envp)
     int cyls, heads, secs, translation;
     QemuOpts *hda_opts = NULL, *opts;
     int optind;
-    const char *r, *optarg;
+    const char *optarg;
     const char *loadvm = NULL;
     QEMUMachine *machine;
     const char *cpu_model;
@@ -4753,38 +4793,12 @@ int main(int argc, char **argv, char **envp)
     for(;;) {
         if (optind >= argc)
             break;
-        r = argv[optind];
-        if (r[0] != '-') {
+        if (argv[optind][0] != '-') {
 	    hda_opts = drive_add(argv[optind++], HD_ALIAS, 0);
         } else {
             const QEMUOption *popt;
 
-            optind++;
-            /* Treat --foo the same as -foo.  */
-            if (r[1] == '-')
-                r++;
-            popt = qemu_options;
-            for(;;) {
-                if (!popt->name) {
-                    fprintf(stderr, "%s: invalid option -- '%s'\n",
-                            argv[0], r);
-                    exit(1);
-                }
-                if (!strcmp(popt->name, r + 1))
-                    break;
-                popt++;
-            }
-            if (popt->flags & HAS_ARG) {
-                if (optind >= argc) {
-                    fprintf(stderr, "%s: option '%s' requires an argument\n",
-                            argv[0], r);
-                    exit(1);
-                }
-                optarg = argv[optind++];
-            } else {
-                optarg = NULL;
-            }
-
+            popt = lookup_opt(argc, argv, &optarg, &optind);
             switch(popt->index) {
             case QEMU_OPTION_M:
                 machine = find_machine(optarg);
-- 
1.6.5.2

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

* [Qemu-devel] [PATCH 3/3] Load global config files by default (v3)
  2010-01-24 14:22 [Qemu-devel] [PATCH 0/4] Introduce global config (v3) Anthony Liguori
  2010-01-24 14:22 ` [Qemu-devel] [PATCH 1/3] Support --sysconfdir in configure to specify path to configuration files (v3) Anthony Liguori
  2010-01-24 14:22 ` [Qemu-devel] [PATCH 2/3] Move out option lookup into a separate function Anthony Liguori
@ 2010-01-24 14:22 ` Anthony Liguori
  2010-01-24 15:00 ` [Qemu-devel] [PATCH 0/4] Introduce global config (v3) Avi Kivity
  2010-01-24 15:04 ` Avi Kivity
  4 siblings, 0 replies; 18+ messages in thread
From: Anthony Liguori @ 2010-01-24 14:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: Anthony Liguori

A new option, -nodefconfig is introduced to prevent loading from the default
config location.  Otherwise, two configuration files will be searched for,
qemu.conf and target-<TARGET_NAME>.conf.

To ensure that the default configuration is overridden by a user specified
config, we introduce a two stage option parsing mechanism.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
v2->v3
 - update to use confdir instead of sysconfdir
v1->v2
 - Introduce two stage option parsing to make sure global config file is
   overridden by command line options
---
 qemu-options.hx |    9 +++++++++
 vl.c            |   39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index ee60d8a..9294e07 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1965,6 +1965,15 @@ STEXI
 @item -writeconfig @var{file}
 Write device configuration to @var{file}.
 ETEXI
+DEF("nodefconfig", 0, QEMU_OPTION_nodefconfig,
+    "-nodefconfig\n"
+    "                do not load default config files at startup\n")
+STEXI
+@item -nodefconfig
+Normally QEMU loads a configuration file from @var{sysconfdir}/qemu.conf and
+@var{sysconfdir}/target-@var{ARCH}.conf on startup.  The @code{-nodefconfig}
+option will prevent QEMU from loading these configuration files at startup.
+ETEXI
 
 HXCOMM This is the last statement. Insert new options before this line!
 STEXI
diff --git a/vl.c b/vl.c
index e00ae0d..7fe6a39 100644
--- a/vl.c
+++ b/vl.c
@@ -4730,6 +4730,7 @@ int main(int argc, char **argv, char **envp)
 #endif
     CPUState *env;
     int show_vnc_port = 0;
+    int defconfig = 1;
 
     init_clocks();
 
@@ -4789,6 +4790,44 @@ int main(int argc, char **argv, char **envp)
     tb_size = 0;
     autostart= 1;
 
+    /* first pass of option parsing */
+    optind = 1;
+    while (optind < argc) {
+        if (argv[optind][0] != '-') {
+            /* disk image */
+            continue;
+        } else {
+            const QEMUOption *popt;
+
+            popt = lookup_opt(argc, argv, &optarg, &optind);
+            switch (popt->index) {
+            case QEMU_OPTION_nodefconfig:
+                defconfig=0;
+                break;
+            }
+        }
+    }
+
+    if (defconfig) {
+        FILE *fp;
+        fp = fopen(CONFIG_QEMU_CONFDIR "/qemu.conf", "r");
+        if (fp) {
+            if (qemu_config_parse(fp) != 0) {
+                exit(1);
+            }
+            fclose(fp);
+        }
+
+        fp = fopen(CONFIG_QEMU_CONFDIR "/target-" TARGET_ARCH ".conf", "r");
+        if (fp) {
+            if (qemu_config_parse(fp) != 0) {
+                exit(1);
+            }
+            fclose(fp);
+        }
+    }
+
+    /* second pass of option parsing */
     optind = 1;
     for(;;) {
         if (optind >= argc)
-- 
1.6.5.2

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

* [Qemu-devel] Re: [PATCH 1/3] Support --sysconfdir in configure to specify path to configuration files (v3)
  2010-01-24 14:22 ` [Qemu-devel] [PATCH 1/3] Support --sysconfdir in configure to specify path to configuration files (v3) Anthony Liguori
@ 2010-01-24 14:45   ` Paolo Bonzini
  2010-01-24 15:23     ` Anthony Liguori
  0 siblings, 1 reply; 18+ messages in thread
From: Paolo Bonzini @ 2010-01-24 14:45 UTC (permalink / raw)
  To: qemu-devel

On 01/24/2010 03:22 PM, Anthony Liguori wrote:
> The default value is ${prefix}/etc/qemu.  --sysconfdir can be used to override
> the default to an absolute path.  The expectation is that when installed to
> /usr, --sysconfdir=/etc/qemu will be used.
>
> Signed-off-by: Anthony Liguori<aliguori@us.ibm.com>
> ---
> v2 ->  v3
>   - default sysconfdir to ${prefix}/etc on unix, ${prefix} on win32
>   - set confdir to ${sysconfdir}/qemu on unix, ${sysconfdir} on win32

I'm not sure about the choice for Windows.  Do we want possibly a dozen 
of .conf files all in the same directory as the binaries, or maybe it's 
better to set sysconfdir = ${prefix}/conf, confdir=${sysconfdir} on Windows?

> +if test "$mingw32" = "yes" ; then
> +  echo "CONFIG_QEMU_CONFDIR=\"$sysconfdir\"" >> $config_host_mak
> +else
> +  echo "CONFIG_QEMU_CONFDIR=\"${sysconfdir}/qemu\"" >> $config_host_mak
> +fi

Also, here you can use $confsuffix as used a bit above to avoid 
introducing an if here.

Anyway, this can be discussed/cleaned up later, this patch gets my ack.

Paolo

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

* Re: [Qemu-devel] [PATCH 0/4] Introduce global config (v3)
  2010-01-24 14:22 [Qemu-devel] [PATCH 0/4] Introduce global config (v3) Anthony Liguori
                   ` (2 preceding siblings ...)
  2010-01-24 14:22 ` [Qemu-devel] [PATCH 3/3] Load global config files by default (v3) Anthony Liguori
@ 2010-01-24 15:00 ` Avi Kivity
  2010-01-24 15:23   ` Anthony Liguori
  2010-01-24 15:04 ` Avi Kivity
  4 siblings, 1 reply; 18+ messages in thread
From: Avi Kivity @ 2010-01-24 15:00 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: John Cooper, Paolo Bonzini, qemu-devel, Gerd Hoffman

On 01/24/2010 04:22 PM, Anthony Liguori wrote:
> This series introduces global config files stored in /etc/qemu.  There is both
> a common config (qemu.conf) and a per-target config (target-<TARGET_NAME>.conf).
>    

Would be nice, in addition, to load per-user configuration from 
~/.qemu/*.conf.

-- 
error compiling committee.c: too many arguments to function

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

* Re: [Qemu-devel] [PATCH 0/4] Introduce global config (v3)
  2010-01-24 14:22 [Qemu-devel] [PATCH 0/4] Introduce global config (v3) Anthony Liguori
                   ` (3 preceding siblings ...)
  2010-01-24 15:00 ` [Qemu-devel] [PATCH 0/4] Introduce global config (v3) Avi Kivity
@ 2010-01-24 15:04 ` Avi Kivity
  2010-01-24 15:10   ` Paolo Bonzini
  2010-01-24 15:25   ` Anthony Liguori
  4 siblings, 2 replies; 18+ messages in thread
From: Avi Kivity @ 2010-01-24 15:04 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: John Cooper, Paolo Bonzini, qemu-devel, Gerd Hoffman

On 01/24/2010 04:22 PM, Anthony Liguori wrote:
> This series introduces global config files stored in /etc/qemu.  There is both
> a common config (qemu.conf) and a per-target config (target-<TARGET_NAME>.conf).
>
> I've removed the default device bits from the series as it requires some more
> thought on how to best integrate it.  That makes this series rather simple.
>    

btw, what does the corresponding patch to our imaginary management tool 
author guide read?  Do we recommend -nodefconfig or not?  I think we 
should, since otherwise qemu behaviour can be completely unexpected by 
the management tool.

-- 
error compiling committee.c: too many arguments to function

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

* Re: [Qemu-devel] [PATCH 0/4] Introduce global config (v3)
  2010-01-24 15:04 ` Avi Kivity
@ 2010-01-24 15:10   ` Paolo Bonzini
  2010-01-25 11:31     ` Daniel P. Berrange
  2010-01-24 15:25   ` Anthony Liguori
  1 sibling, 1 reply; 18+ messages in thread
From: Paolo Bonzini @ 2010-01-24 15:10 UTC (permalink / raw)
  To: Avi Kivity; +Cc: John Cooper, Anthony Liguori, qemu-devel, Gerd Hoffman

On 01/24/2010 04:04 PM, Avi Kivity wrote:
> On 01/24/2010 04:22 PM, Anthony Liguori wrote:
>> This series introduces global config files stored in /etc/qemu. There
>> is both
>> a common config (qemu.conf) and a per-target config
>> (target-<TARGET_NAME>.conf).
>>
>> I've removed the default device bits from the series as it requires
>> some more
>> thought on how to best integrate it. That makes this series rather
>> simple.
>
> btw, what does the corresponding patch to our imaginary management tool
> author guide read? Do we recommend -nodefconfig or not? I think we
> should, since otherwise qemu behaviour can be completely unexpected by
> the management tool.

I think so, the next version of libvirt will use -nodefaults, and 
-nodefconfig is in the same group.

Paolo

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

* Re: [Qemu-devel] Re: [PATCH 1/3] Support --sysconfdir in configure to specify path to configuration files (v3)
  2010-01-24 14:45   ` [Qemu-devel] " Paolo Bonzini
@ 2010-01-24 15:23     ` Anthony Liguori
  2010-01-25 14:43       ` Avi Kivity
  0 siblings, 1 reply; 18+ messages in thread
From: Anthony Liguori @ 2010-01-24 15:23 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On 01/24/2010 08:45 AM, Paolo Bonzini wrote:
> On 01/24/2010 03:22 PM, Anthony Liguori wrote:
>> The default value is ${prefix}/etc/qemu.  --sysconfdir can be used to 
>> override
>> the default to an absolute path.  The expectation is that when 
>> installed to
>> /usr, --sysconfdir=/etc/qemu will be used.
>>
>> Signed-off-by: Anthony Liguori<aliguori@us.ibm.com>
>> ---
>> v2 ->  v3
>>   - default sysconfdir to ${prefix}/etc on unix, ${prefix} on win32
>>   - set confdir to ${sysconfdir}/qemu on unix, ${sysconfdir} on win32
>
> I'm not sure about the choice for Windows.  Do we want possibly a 
> dozen of .conf files all in the same directory as the binaries, or 
> maybe it's better to set sysconfdir = ${prefix}/conf, 
> confdir=${sysconfdir} on Windows?

I honestly don't know.  What's the normal thing to do with Windows?

>
>> +if test "$mingw32" = "yes" ; then
>> +  echo "CONFIG_QEMU_CONFDIR=\"$sysconfdir\"" >> $config_host_mak
>> +else
>> +  echo "CONFIG_QEMU_CONFDIR=\"${sysconfdir}/qemu\"" >> $config_host_mak
>> +fi
>
> Also, here you can use $confsuffix as used a bit above to avoid 
> introducing an if here.
>
> Anyway, this can be discussed/cleaned up later, this patch gets my ack.

Regards,

Anthony Liguori

> Paolo
>
>
>

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

* Re: [Qemu-devel] [PATCH 0/4] Introduce global config (v3)
  2010-01-24 15:00 ` [Qemu-devel] [PATCH 0/4] Introduce global config (v3) Avi Kivity
@ 2010-01-24 15:23   ` Anthony Liguori
  0 siblings, 0 replies; 18+ messages in thread
From: Anthony Liguori @ 2010-01-24 15:23 UTC (permalink / raw)
  To: Avi Kivity; +Cc: John Cooper, Paolo Bonzini, qemu-devel, Gerd Hoffman

On 01/24/2010 09:00 AM, Avi Kivity wrote:
> On 01/24/2010 04:22 PM, Anthony Liguori wrote:
>> This series introduces global config files stored in /etc/qemu.  
>> There is both
>> a common config (qemu.conf) and a per-target config 
>> (target-<TARGET_NAME>.conf).
>
> Would be nice, in addition, to load per-user configuration from 
> ~/.qemu/*.conf.

Indeed.  I'll make a follow on patch.

Regards,

Anthony Liguori

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

* Re: [Qemu-devel] [PATCH 0/4] Introduce global config (v3)
  2010-01-24 15:04 ` Avi Kivity
  2010-01-24 15:10   ` Paolo Bonzini
@ 2010-01-24 15:25   ` Anthony Liguori
  1 sibling, 0 replies; 18+ messages in thread
From: Anthony Liguori @ 2010-01-24 15:25 UTC (permalink / raw)
  To: Avi Kivity
  Cc: John Cooper, Paolo Bonzini, Anthony Liguori, qemu-devel, Gerd Hoffman

On 01/24/2010 09:04 AM, Avi Kivity wrote:
> On 01/24/2010 04:22 PM, Anthony Liguori wrote:
>> This series introduces global config files stored in /etc/qemu.  
>> There is both
>> a common config (qemu.conf) and a per-target config 
>> (target-<TARGET_NAME>.conf).
>>
>> I've removed the default device bits from the series as it requires 
>> some more
>> thought on how to best integrate it.  That makes this series rather 
>> simple.
>
> btw, what does the corresponding patch to our imaginary management 
> tool author guide read?  Do we recommend -nodefconfig or not?  I think 
> we should, since otherwise qemu behaviour can be completely unexpected 
> by the management tool.

It depends.  I think there are two classes of management tools.  The 
first class, like libvirt, completely hides the details of QEMU from the 
user.  For libvirt, it should definitely use -nodefconfig because a user 
should not be encouraged to tweak bits without libvirt knowing about it.

A second class of management tools would work with QEMU and basically 
extend what we currently expose.  IOW, guest's would be represented 
through our native config file, full access would be provided to 
monitor/QMP commands.  For this class of tools, a user should be 
encouraged to use the default configuration files to make global changes 
to a particular node.

Regards,

Anthony Liguori

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

* Re: [Qemu-devel] [PATCH 0/4] Introduce global config (v3)
  2010-01-24 15:10   ` Paolo Bonzini
@ 2010-01-25 11:31     ` Daniel P. Berrange
  2010-01-25 13:59       ` Anthony Liguori
  0 siblings, 1 reply; 18+ messages in thread
From: Daniel P. Berrange @ 2010-01-25 11:31 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: John Cooper, Anthony Liguori, Gerd Hoffman, Avi Kivity, qemu-devel

On Sun, Jan 24, 2010 at 04:10:35PM +0100, Paolo Bonzini wrote:
> On 01/24/2010 04:04 PM, Avi Kivity wrote:
> >On 01/24/2010 04:22 PM, Anthony Liguori wrote:
> >>This series introduces global config files stored in /etc/qemu. There
> >>is both
> >>a common config (qemu.conf) and a per-target config
> >>(target-<TARGET_NAME>.conf).
> >>
> >>I've removed the default device bits from the series as it requires
> >>some more
> >>thought on how to best integrate it. That makes this series rather
> >>simple.
> >
> >btw, what does the corresponding patch to our imaginary management tool
> >author guide read? Do we recommend -nodefconfig or not? I think we
> >should, since otherwise qemu behaviour can be completely unexpected by
> >the management tool.
> 
> I think so, the next version of libvirt will use -nodefaults, and 
> -nodefconfig is in the same group.

It sounds like we need to add -nodefconfig too, unless -nodefaults will
automatically imply  -nodefconfig too ?


Daniel
-- 
|: 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 :|

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

* Re: [Qemu-devel] [PATCH 0/4] Introduce global config (v3)
  2010-01-25 11:31     ` Daniel P. Berrange
@ 2010-01-25 13:59       ` Anthony Liguori
  0 siblings, 0 replies; 18+ messages in thread
From: Anthony Liguori @ 2010-01-25 13:59 UTC (permalink / raw)
  To: Daniel P. Berrange
  Cc: Anthony Liguori, John Cooper, qemu-devel, Gerd Hoffman,
	Paolo Bonzini, Avi Kivity

On 01/25/2010 05:31 AM, Daniel P. Berrange wrote:
> On Sun, Jan 24, 2010 at 04:10:35PM +0100, Paolo Bonzini wrote:
>    
>> On 01/24/2010 04:04 PM, Avi Kivity wrote:
>>      
>>> On 01/24/2010 04:22 PM, Anthony Liguori wrote:
>>>        
>>>> This series introduces global config files stored in /etc/qemu. There
>>>> is both
>>>> a common config (qemu.conf) and a per-target config
>>>> (target-<TARGET_NAME>.conf).
>>>>
>>>> I've removed the default device bits from the series as it requires
>>>> some more
>>>> thought on how to best integrate it. That makes this series rather
>>>> simple.
>>>>          
>>> btw, what does the corresponding patch to our imaginary management tool
>>> author guide read? Do we recommend -nodefconfig or not? I think we
>>> should, since otherwise qemu behaviour can be completely unexpected by
>>> the management tool.
>>>        
>> I think so, the next version of libvirt will use -nodefaults, and
>> -nodefconfig is in the same group.
>>      
> It sounds like we need to add -nodefconfig too, unless -nodefaults will
> automatically imply  -nodefconfig too ?
>    

Right now, -nodefaults does not imply -nodefconfig.

Regards,

Anthony Liguori

> Daniel
>    

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

* Re: [Qemu-devel] Re: [PATCH 1/3] Support --sysconfdir in configure to specify path to configuration files (v3)
  2010-01-24 15:23     ` Anthony Liguori
@ 2010-01-25 14:43       ` Avi Kivity
  2010-01-25 21:05         ` Paolo Bonzini
  0 siblings, 1 reply; 18+ messages in thread
From: Avi Kivity @ 2010-01-25 14:43 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Paolo Bonzini, qemu-devel

On 01/24/2010 05:23 PM, Anthony Liguori wrote:
> On 01/24/2010 08:45 AM, Paolo Bonzini wrote:
>> On 01/24/2010 03:22 PM, Anthony Liguori wrote:
>>> The default value is ${prefix}/etc/qemu.  --sysconfdir can be used 
>>> to override
>>> the default to an absolute path.  The expectation is that when 
>>> installed to
>>> /usr, --sysconfdir=/etc/qemu will be used.
>>>
>>> Signed-off-by: Anthony Liguori<aliguori@us.ibm.com>
>>> ---
>>> v2 ->  v3
>>>   - default sysconfdir to ${prefix}/etc on unix, ${prefix} on win32
>>>   - set confdir to ${sysconfdir}/qemu on unix, ${sysconfdir} on win32
>>
>> I'm not sure about the choice for Windows.  Do we want possibly a 
>> dozen of .conf files all in the same directory as the binaries, or 
>> maybe it's better to set sysconfdir = ${prefix}/conf, 
>> confdir=${sysconfdir} on Windows?
>
> I honestly don't know.  What's the normal thing to do with Windows?

The registry, I think.

-- 
error compiling committee.c: too many arguments to function

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

* Re: [Qemu-devel] Re: [PATCH 1/3] Support --sysconfdir in configure to specify path to configuration files (v3)
  2010-01-25 14:43       ` Avi Kivity
@ 2010-01-25 21:05         ` Paolo Bonzini
  2010-01-25 21:14           ` Anthony Liguori
  2010-01-26  8:56           ` Avi Kivity
  0 siblings, 2 replies; 18+ messages in thread
From: Paolo Bonzini @ 2010-01-25 21:05 UTC (permalink / raw)
  To: Avi Kivity; +Cc: qemu-devel


>>> I'm not sure about the choice for Windows. Do we want possibly a
>>> dozen of .conf files all in the same directory as the binaries, or
>>> maybe it's better to set sysconfdir = ${prefix}/conf,
>>> confdir=${sysconfdir} on Windows?
>>
>> I honestly don't know. What's the normal thing to do with Windows?
>
> The registry, I think.

The registry would be used indeed to get the path or to override 
defaults.  However, what would be the default value (written in the 
registry by the installer, or used by the program if the registry value 
is absent)?

Paolo

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

* Re: [Qemu-devel] Re: [PATCH 1/3] Support --sysconfdir in configure to specify path to configuration files (v3)
  2010-01-25 21:05         ` Paolo Bonzini
@ 2010-01-25 21:14           ` Anthony Liguori
  2010-01-25 21:19             ` Paolo Bonzini
  2010-01-26  8:56           ` Avi Kivity
  1 sibling, 1 reply; 18+ messages in thread
From: Anthony Liguori @ 2010-01-25 21:14 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Avi Kivity, qemu-devel

On 01/25/2010 03:05 PM, Paolo Bonzini wrote:
>
>>>> I'm not sure about the choice for Windows. Do we want possibly a
>>>> dozen of .conf files all in the same directory as the binaries, or
>>>> maybe it's better to set sysconfdir = ${prefix}/conf,
>>>> confdir=${sysconfdir} on Windows?
>>>
>>> I honestly don't know. What's the normal thing to do with Windows?
>>
>> The registry, I think.
>
> The registry would be used indeed to get the path or to override 
> defaults.  However, what would be the default value (written in the 
> registry by the installer, or used by the program if the registry 
> value is absent)?

ini-style configs are not at all uncommon on Windows.  I also don't 
think it's that uncommon to store executables and config files 
side-by-side in a Program Files directory.

Regards,

Anthony Liguori

> Paolo

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

* Re: [Qemu-devel] Re: [PATCH 1/3] Support --sysconfdir in configure to specify path to configuration files (v3)
  2010-01-25 21:14           ` Anthony Liguori
@ 2010-01-25 21:19             ` Paolo Bonzini
  0 siblings, 0 replies; 18+ messages in thread
From: Paolo Bonzini @ 2010-01-25 21:19 UTC (permalink / raw)
  To: Anthony Liguori, Avi Kivity, qemu-devel

On 01/25/2010 10:14 PM, Anthony Liguori wrote:
> On 01/25/2010 03:05 PM, Paolo Bonzini wrote:
>>
>>>>> I'm not sure about the choice for Windows. Do we want
>>>>> possibly a dozen of .conf files all in the same directory as
>>>>> the binaries, or maybe it's better to set sysconfdir =
>>>>> ${prefix}/conf, confdir=${sysconfdir} on Windows?
>>>>
>>>> I honestly don't know. What's the normal thing to do with
>>>> Windows?
>>>
>>> The registry, I think.
>>
>> The registry would be used indeed to get the path or to override
>> defaults. However, what would be the default value (written in the
>> registry by the installer, or used by the program if the registry
>> value is absent)?
>
> ini-style configs are not at all uncommon on Windows. I also don't
> think it's that uncommon to store executables and config files
> side-by-side in a Program Files directory.

Indeed, that's what I'm saying.  The registry may hold a path to the
ini files, but you would still have to think of a sane default.  You
chose the binaries' directory, fine, that's not a huge deal---someone
who cares about Windows can step up and say what they think.

Paolo

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

* Re: [Qemu-devel] Re: [PATCH 1/3] Support --sysconfdir in configure to specify path to configuration files (v3)
  2010-01-25 21:05         ` Paolo Bonzini
  2010-01-25 21:14           ` Anthony Liguori
@ 2010-01-26  8:56           ` Avi Kivity
  1 sibling, 0 replies; 18+ messages in thread
From: Avi Kivity @ 2010-01-26  8:56 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel

On 01/25/2010 11:05 PM, Paolo Bonzini wrote:
>
>>>> I'm not sure about the choice for Windows. Do we want possibly a
>>>> dozen of .conf files all in the same directory as the binaries, or
>>>> maybe it's better to set sysconfdir = ${prefix}/conf,
>>>> confdir=${sysconfdir} on Windows?
>>>
>>> I honestly don't know. What's the normal thing to do with Windows?
>>
>> The registry, I think.
>
> The registry would be used indeed to get the path or to override 
> defaults.  However, what would be the default value (written in the 
> registry by the installer, or used by the program if the registry 
> value is absent)?

You could use the registry to hold the defaults, not a path to the defaults.

-- 
error compiling committee.c: too many arguments to function

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

end of thread, other threads:[~2010-01-26  8:56 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-24 14:22 [Qemu-devel] [PATCH 0/4] Introduce global config (v3) Anthony Liguori
2010-01-24 14:22 ` [Qemu-devel] [PATCH 1/3] Support --sysconfdir in configure to specify path to configuration files (v3) Anthony Liguori
2010-01-24 14:45   ` [Qemu-devel] " Paolo Bonzini
2010-01-24 15:23     ` Anthony Liguori
2010-01-25 14:43       ` Avi Kivity
2010-01-25 21:05         ` Paolo Bonzini
2010-01-25 21:14           ` Anthony Liguori
2010-01-25 21:19             ` Paolo Bonzini
2010-01-26  8:56           ` Avi Kivity
2010-01-24 14:22 ` [Qemu-devel] [PATCH 2/3] Move out option lookup into a separate function Anthony Liguori
2010-01-24 14:22 ` [Qemu-devel] [PATCH 3/3] Load global config files by default (v3) Anthony Liguori
2010-01-24 15:00 ` [Qemu-devel] [PATCH 0/4] Introduce global config (v3) Avi Kivity
2010-01-24 15:23   ` Anthony Liguori
2010-01-24 15:04 ` Avi Kivity
2010-01-24 15:10   ` Paolo Bonzini
2010-01-25 11:31     ` Daniel P. Berrange
2010-01-25 13:59       ` Anthony Liguori
2010-01-24 15:25   ` Anthony Liguori

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.