[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] introduce environment variables for all qemu-us
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH] introduce environment variables for all qemu-user options |
Date: |
Sun, 31 Jul 2011 13:12:02 +0100 |
On 31 July 2011 12:51, <address@hidden> wrote:
> + if ((r = getenv("QEMU_STACK_SIZE")) != NULL) {
> + guest_stack_size = strtoul(r, (char **)&r, 0);
> + if (guest_stack_size == 0)
> + usage();
> + if (*r == 'M')
> + guest_stack_size *= 1024 * 1024;
> + else if (*r == 'k' || *r == 'K')
> + guest_stack_size *= 1024;
> + }
[etc]
This is all basically duplicating the existing command line
argument parsing code, which (a) makes it very easy for the
two to drift out of sync in future and (b) means command line
options added in future might end up without a corresponding
environment variable.
I think it would be much nicer to have this be table-driven,
to avoid the code duplication. It ought to be possible to
derive most of the extra --help text from the table too.
-- PMM
- [Qemu-devel] [PATCH] add QEMU_LD_PREFIX environment variable, (continued)
- [Qemu-devel] [PATCH] add QEMU_LD_PREFIX environment variable, josch, 2011/07/23
- Re: [Qemu-devel] Bug#632192: [PATCH] add QEMU_LD_PREFIX environment variable, Vagrant Cascadian, 2011/07/29
- Re: [Qemu-devel] Bug#632192: [PATCH] add QEMU_LD_PREFIX environment variable, Johannes Schauer, 2011/07/29
- Re: [Qemu-devel] Bug#632192: [PATCH] add QEMU_LD_PREFIX environment variable, Riku Voipio, 2011/07/30
- [Qemu-devel] [PATCH] introduce environment variables for all qemu-user options, j . schauer, 2011/07/31
- Re: [Qemu-devel] [PATCH] introduce environment variables for all qemu-user options,
Peter Maydell <=
- [Qemu-devel] [PATCH] introduce environment variables for all qemu-user options, Johannes Schauer, 2011/07/31