History | View | Annotate | Download (20.6 kB)
QemuOpts: allow larger option values.
Use case: loooooooooooooooooong file names for -drive file=...
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-opts: Release id on deletion
The opts id is always allocated via qemu_strdup, so it need not beconst, but it has to be released on opts deletion.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Remove bogus error message from qemu_opts_set()
The only way qemu_opts_create() can fail is if a QemuOpts with that idalready exists and fail_if_exists=1. In that case, we already printan error which makes more sense than the one in qemu_opts_set().
Signed-off-by: Mark McLoughlin <markmc@redhat.com>...
Make qemu_opts_parse() handle empty strings
Rather than making callers explicitly handle empty strings by usingqemu_opts_create(), we can easily have qemu_opts_parse() handleempty parameter strings.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Add qemu_opts_validate() for post parsing validation
Several qemu command line options have a parameter whose value affectswhat other parameters are accepted for the option.
In these cases, we can have an empty description table in theQemuOptsList and once the option has been parsed we can use a suitable...
Never overwrite a QemuOpt
Rather than overwriting a QemuOpt, just add a new one to the tail andalways do a reverse search for parameters to preserve the samebehaviour. We use this order so that foreach() iterates over the optsin their original order....
qemu-option: rename bool -> boolean
We need this to allow the use of <stdbool.h>
Signed-off-by: Juan Quintela <quintela@redhat.com>Acked-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Fix coding style issue
Replace:
if (-1 foo())
with:
if (foo() -1)
While this coding style is not in direct contravention of our currentlyratified CODING_STYLE treaty, it could be argued that the Article 3 ofthe European Convention on Human Rights (prohibiting torture and "inhuman...
Fix sys-queue.h conflict for good
Problem: Our file sys-queue.h is a copy of the BSD file, but there aresome additions and it's not entirely compatible. Because of that, there havebeen conflicts with system headers on BSD systems. Some hacks have beenintroduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896,...
QemuOpts: split option parser into two functions.
looking for id= and creating a new QemuOpts instance is splitted fromthe actual option parser code now, so the parser can be called fromother contexts too.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>...
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 <jcd@tribudubois.net>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
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
QemuOpts: add some functions
qemu_opt_foreach: loop over all QemuOpts entries.qemu_opts_id: return QemuOpts id.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Message-Id:
qemu-option: fix parse_option_number().
It works much better when parse_option_number actuallyreturns 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 <avi@redhat.com>...
move parser functions from vl.c to qemu-option.c
qemu-option: factor out parse_option_bool
qemu-option: factor out parse_option_size
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....
qemu-img: Print available options with -o ?
This patch adds a small help text to each of the options in the block driverswhich can be displayed by using qemu-img create -f fmt -o ?
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Create qemu-option.h
This patch creates a new header file and the corresponding implementation filefor parsing of parameter strings for options (like used in -drive). Part ofthis 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...