Statistics
| Branch: | Revision:

root / qemu-option.c @ 6a957025

History | View | Annotate | Download (20.6 kB)

# Date Author Comment
a676968b 10/06/2009 10:36 pm Mark McLoughlin

Remove bogus error message from qemu_opts_set()

The only way qemu_opts_create() can fail is if a QemuOpts with that id
already exists and fail_if_exists=1. In that case, we already print
an error which makes more sense than the one in qemu_opts_set().

Signed-off-by: Mark McLoughlin <>...

2cfa571f 10/06/2009 10:36 pm Mark McLoughlin

Make qemu_opts_parse() handle empty strings

Rather than making callers explicitly handle empty strings by using
qemu_opts_create(), we can easily have qemu_opts_parse() handle
empty parameter strings.

Signed-off-by: Mark McLoughlin <>
Signed-off-by: Anthony Liguori <>

5dc519ef 10/06/2009 10:36 pm Mark McLoughlin

Add qemu_opts_validate() for post parsing validation

Several qemu command line options have a parameter whose value affects
what other parameters are accepted for the option.

In these cases, we can have an empty description table in the
QemuOptsList and once the option has been parsed we can use a suitable...

dc9ca4ba 10/06/2009 10:36 pm Mark McLoughlin

Never overwrite a QemuOpt

Rather than overwriting a QemuOpt, just add a new one to the tail and
always do a reverse search for parameters to preserve the same
behaviour. We use this order so that foreach() iterates over the opts
in their original order.
...

1f5c1775 09/26/2009 10:34 pm Juan Quintela

qemu-option: rename bool -> boolean

We need this to allow the use of <stdbool.h>

Signed-off-by: Juan Quintela <>
Acked-by: Gerd Hoffmann <>
Signed-off-by: Aurelien Jarno <>

3df04ac3 09/25/2009 10:57 pm Mark McLoughlin

Fix coding style issue

Replace:

if (-1  foo())

with:

if (foo()  -1)

While this coding style is not in direct contravention of our currently
ratified CODING_STYLE treaty, it could be argued that the Article 3 of
the European Convention on Human Rights (prohibiting torture and "inhuman...

72cf2d4f 09/12/2009 10:36 am Blue Swirl

Fix sys-queue.h conflict for good

Problem: Our file sys-queue.h is a copy of the BSD file, but there are
some additions and it's not entirely compatible. Because of that, there have
been conflicts with system headers on BSD systems. Some hacks have been
introduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,...

96729cbd 09/11/2009 06:19 pm Gerd Hoffmann

QemuOpts: split option parser into two functions.

looking for id= and creating a new QemuOpts instance is splitted from
the actual option parser code now, so the parser can be called from
other contexts too.

Signed-off-by: Gerd Hoffmann <>...

d4c3fddd 09/09/2009 10:57 pm Jean-Christophe DUBOIS

mv from strdup to qemu_strdup in qemu-option.c

one place is using strdup() instead of qemu_strdup

Fix it

Signed-off-by: Jean-Christophe Dubois <>
Signed-off-by: Anthony Liguori <>

6d378185 08/10/2009 09:05 pm Gerd Hoffmann

QemuOpts: qemu_opts_parse: fix id= parsing

We can't use get_param_value(), it can't handle parameters without
'=' in there. Examples not working because of that:

-device foo,id=bar
-device file=/path/image,format=qcow2,snapshot,id=disk0

Signed-off-by: Gerd Hoffmann <>...

48026075 08/10/2009 09:05 pm Gerd Hoffmann

QemuOpts: add some functions

qemu_opt_foreach: loop over all QemuOpts entries.
qemu_opts_id: return QemuOpts id.

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>
Message-Id:

21c9f4cd 07/30/2009 05:50 pm Gerd Hoffmann

qemu-option: fix parse_option_number().

It works much better when parse_option_number actually
returns the number parsed ...

Common breakage resulting from this bug is that
'qemu -hda foo.img -cdrom bar.iso' stops working
(cdrom isn't there).

Cc: Avi Kivity <>...

62c5802e 07/27/2009 10:08 pm Gerd Hoffmann

move parser functions from vl.c to qemu-option.c

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

67b1355b 07/27/2009 10:08 pm Gerd Hoffmann

qemu-option: factor out parse_option_bool

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

7695019b 07/27/2009 10:08 pm Gerd Hoffmann

qemu-option: factor out parse_option_size

Signed-off-by: Gerd Hoffmann <>
Signed-off-by: Anthony Liguori <>

e27c88fe 07/27/2009 10:08 pm Gerd Hoffmann

QemuOpts: framework for storing and parsing options.

This stores device parameters in a better way than unparsed strings.

New types:
QemuOpt - one key-value pair.
QemuOpts - group of key-value pairs, belonging to one
device, i.e. one drive....

db08adf5 06/06/2009 06:38 pm Kevin Wolf

qemu-img: Print available options with -o ?

This patch adds a small help text to each of the options in the block drivers
which can be displayed by using qemu-img create -f fmt -o ?

Signed-off-by: Kevin Wolf <>

d3f24367 05/22/2009 06:50 pm Kevin Wolf

Create qemu-option.h

This patch creates a new header file and the corresponding implementation file
for parsing of parameter strings for options (like used in -drive). Part of
this is code moved from vl.c (so qemu-img can use it later).

The idea is to have a data structure describing all accepted parameters. When...