QEMU With E2K User Support
Go to file
Laszlo Ersek eb7ee2cbeb qapi: introduce OptsVisitor
This visitor supports parsing

  -option [type=]discriminator[,optarg1=val1][,optarg2=val2][,...]

style QemuOpts objects into "native" C structures. After defining the type
tree in the qapi schema (see below), a root type traversal with this
visitor linked to the underlying QemuOpts object will build the "native" C
representation of the option.

The type tree in the schema, corresponding to an option with a
discriminator, must have the following structure:

  struct
    scalar member for non-discriminated optarg 1 [*]
    list for repeating non-discriminated optarg 2 [*]
      wrapper struct
        single scalar member
    union
      struct for discriminator case 1
        scalar member for optarg 3 [*]
        list for repeating optarg 4 [*]
          wrapper struct
            single scalar member
        scalar member for optarg 5 [*]
      struct for discriminator case 2
        ...

The "type" optarg name is fixed for the discriminator role. Its schema
representation is "union of structures", and each discriminator value must
correspond to a member name in the union.

If the option takes no "type" descriminator, then the type subtree rooted
at the union must be absent from the schema (including the union itself).

Optarg values can be of scalar types str / bool / integers / size.

Members marked with [*] may be defined as optional in the schema,
describing an optional optarg.

Repeating an optarg is supported; its schema representation must be "list
of structure with single mandatory scalar member". If an optarg is not
described as repeating in the schema (ie. it is defined as a scalar field
instead of a list), its last occurrence will take effect. Ordering between
differently named optargs is not preserved.

A mandatory list (or an optional one which is reported to be available),
corresponding to a repeating optarg, has at least one element after
successful parsing.

v1->v2:
- Update opts_type_size() prototype to uint64_t.
- Add opts_type_uint64() for options needing the full uint64_t range.
  (Internals could be extracted to "cutils.c".)
- Allow negative values in opts_type_int().
- Rebase to nested Makefiles.

v2->v3:
- Factor opts_visitor_insert() out of opts_start_struct() and call it
  separately for opts_root->id if there's any.
- Don't require non-negative values in opts_type_int()'s error message.
- g_malloc0() may return NULL for zero-sized requests. Support empty
  structures by requesting 1 byte for them instead.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23 11:55:17 +01:00
audio audio: Unbreak capturing in mixemu case 2012-07-16 18:08:36 +04:00
block vvfat: Do not clobber the user's geometry 2012-07-17 16:48:30 +02:00
bsd-user
default-configs esp: add AMD PCscsi emulation (PCI SCSI adapter) 2012-07-14 10:13:29 +00:00
docs qapi: fix error propagation 2012-07-23 11:55:17 +01:00
fpu
fsdev
gdb-xml
hw Merge remote-tracking branch 'kwolf/for-anthony' into staging 2012-07-18 14:44:50 -05:00
include/qemu
libcacard
linux-headers
linux-user
net slirp: Improve error reporting of inaccessible smb directories 2012-07-09 17:39:24 +02:00
pc-bios qemu-keymaps: Finnish keyboard mapping broken 2012-07-13 10:38:16 +01:00
qapi qapi: introduce OptsVisitor 2012-07-23 11:55:17 +01:00
qga
QMP
qom
roms Add vgabios build rules to roms/Makefile 2012-07-12 15:25:54 +02:00
scripts qapi: introduce "size" type 2012-07-23 11:55:17 +01:00
slirp
sysconfigs/target
target-alpha
target-arm target-arm: Add support for long format translation table walks 2012-07-12 10:59:54 +00:00
target-cris
target-i386 Merge remote-tracking branch 'qemu-kvm/uq/master' into staging 2012-07-18 14:44:43 -05:00
target-lm32
target-m68k
target-microblaze
target-mips
target-ppc pseries: Convert sPAPR TCEs to use generic IOMMU infrastructure 2012-06-27 16:33:25 -05:00
target-s390x s390: autodetect map private 2012-07-10 18:27:33 +02:00
target-sh4
target-sparc
target-unicore32
target-xtensa
tcg tci: don't write zero for reloc in tci_out_label 2012-06-24 12:19:24 +00:00
tests qapi: add test case for deallocating traversal of incomplete structure 2012-07-23 11:55:17 +01:00
trace
ui Remove support for non-threaded VNC server 2012-06-27 16:27:00 -05:00
.gitignore .gitignore update 2012-07-07 09:04:42 +00:00
.gitmodules
.mailmap
a.out.h
acl.c
acl.h
aes.c
aes.h
aio.c
alpha-dis.c
alpha.ld
arch_init.c Maintain the number of dirty pages 2012-06-29 13:31:07 +02:00
arch_init.h
arm-dis.c
arm.ld
async.c
balloon.c
balloon.h
bitmap.c
bitmap.h
bitops.c
bitops.h bitops: Fix documentation 2012-07-13 10:38:16 +01:00
block_int.h block: Geometry and translation hints are now useless, purge them 2012-07-17 16:48:31 +02:00
block-migration.c Add MigrationParams structure 2012-06-29 13:18:21 +02:00
block-migration.h
block.c block: Geometry and translation hints are now useless, purge them 2012-07-17 16:48:31 +02:00
block.h hw/block-common: Move BlockConf & friends from block.h 2012-07-17 16:48:32 +02:00
blockdev.c blockdev: Don't limit DriveInfo serial to 20 characters 2012-07-17 16:48:32 +02:00
blockdev.h blockdev: Don't limit DriveInfo serial to 20 characters 2012-07-17 16:48:32 +02:00
bswap.h
bt-host.c
bt-host.h
bt-vhci.c
buffered_file.c
buffered_file.h
cache-utils.c
cache-utils.h
Changelog
cmd.c
cmd.h
CODING_STYLE
compatfd.c
compatfd.h
compiler.h
config.h
configure Revert "audio: Make PC speaker audio card available by default" 2012-07-19 18:25:52 -05:00
console.c console: Implementing blinking of cursor 2012-07-14 10:49:01 +00:00
console.h
COPYING
COPYING.LIB
coroutine-gthread.c
coroutine-sigaltstack.c
coroutine-ucontext.c coroutine-ucontext: Help valgrind understand coroutines 2012-07-17 16:48:32 +02:00
coroutine-win32.c
cpu-all.h Maintain the number of dirty pages 2012-06-29 13:31:07 +02:00
cpu-common.h cpu-common.h: Remove a pointless ifndef CONFIG_USER_ONLY 2012-07-02 10:10:07 +01:00
cpu-defs.h
cpu-exec.c apic: Defer interrupt updates to VCPU thread 2012-07-10 11:31:09 +03:00
cpus.c
cpus.h
cputlb.c
cputlb.h
cris-dis.c
cursor_hidden.xpm
cursor_left_ptr.xpm
cursor.c
cutils.c
def-helper.h
device_tree.c
device_tree.h
dis-asm.h
disas.c disas: Fix printing of addresses in disassembly 2012-07-14 10:32:34 +00:00
disas.h
dma-helpers.c Add a memory barrier to DMA functions 2012-06-27 16:33:26 -05:00
dma.h Add a memory barrier to DMA functions 2012-06-27 16:33:26 -05:00
dump-stub.c
dump.c
dump.h
dyngen-exec.h
elf.h
envlist.c
envlist.h
error_int.h
error.c qapi: fix error propagation 2012-07-23 11:55:17 +01:00
error.h qapi: fix error propagation 2012-07-23 11:55:17 +01:00
event_notifier.c event_notifier: add event_notifier_set_handler 2012-07-12 14:08:10 +03:00
event_notifier.h event_notifier: add event_notifier_set_handler 2012-07-12 14:08:10 +03:00
exec-all.h
exec-memory.h
exec-obsolete.h Maintain the number of dirty pages 2012-06-29 13:31:07 +02:00
exec.c Merge remote-tracking branch 'qemu-kvm/uq/master' into staging 2012-07-18 14:44:43 -05:00
gdbstub.c
gdbstub.h
gen-icount.h
HACKING
hmp-commands.hx qapi: Convert getfd and closefd 2012-07-13 13:46:55 -03:00
hmp.c qapi: Convert getfd and closefd 2012-07-13 13:46:55 -03:00
hmp.h qapi: Convert getfd and closefd 2012-07-13 13:46:55 -03:00
host-utils.c
host-utils.h
hppa-dis.c
hppa.ld
i386-dis.c
i386.ld
ia64-dis.c
ia64.ld
input.c
int128.h
iohandler.c
ioport.c
ioport.h
iorange.h
iov.c iov: Fix do_send_recv() for MinGW (also fixes a build breakage) 2012-07-11 08:51:50 -05:00
iov.h
json-lexer.c
json-lexer.h
json-parser.c
json-parser.h
json-streamer.c
json-streamer.h
kvm-all.c Merge remote-tracking branch 'qemu-kvm/uq/master' into staging 2012-07-18 14:44:43 -05:00
kvm-stub.c virtio: move common irqfd handling out of virtio-pci 2012-07-12 14:08:11 +03:00
kvm.h Merge remote-tracking branch 'qemu-kvm/uq/master' into staging 2012-07-18 14:44:43 -05:00
libfdt_env.h
LICENSE
linux-aio.c
lm32-dis.c
m68k-dis.c
m68k.ld
main-loop.c
main-loop.h
MAINTAINERS MAINTAINERS: Replace net maintainer Mark McLoughlin with Stefan Hajnoczi 2012-07-23 11:55:17 +01:00
Makefile build: fix build breakage due to bad merge 2012-07-17 18:58:20 -05:00
Makefile.dis
Makefile.hw
Makefile.objs Merge remote-tracking branch 'mjt/mjt-iov2' into staging 2012-07-09 12:35:06 -05:00
Makefile.target bsd-user: fix build 2012-06-28 20:28:36 +00:00
Makefile.user
memory_mapping-stub.c
memory_mapping.c
memory_mapping.h
memory.c memory: pass EventNotifier, not eventfd 2012-07-12 14:08:10 +03:00
memory.h memory: pass EventNotifier, not eventfd 2012-07-12 14:08:10 +03:00
microblaze-dis.c
migration-exec.c
migration-fd.c
migration-tcp.c
migration-unix.c
migration.c Add spent time for migration 2012-06-29 13:27:28 +02:00
migration.h Add spent time for migration 2012-06-29 13:27:28 +02:00
mips-dis.c
mips.ld
module.c
module.h
monitor.c Merge remote-tracking branch 'qmp/queue/qmp' into staging 2012-07-18 14:44:37 -05:00
monitor.h
nbd.c
nbd.h
net.c
net.h
notify.c
notify.h
os-posix.c
os-win32.c
osdep.c
osdep.h
oslib-posix.c s390: autodetect map private 2012-07-10 18:27:33 +02:00
oslib-win32.c
path.c
pci-ids.txt
pflib.c
pflib.h
poison.h
posix-aio-compat.c
ppc64.ld
ppc-dis.c
ppc.ld
qapi-schema-guest.json
qapi-schema-test.json
qapi-schema.json qapi: Convert getfd and closefd 2012-07-13 13:46:55 -03:00
qbool.c
qbool.h
qdict-test-data.txt
qdict.c
qdict.h
qemu_socket.h
qemu-aio.h
qemu-barrier.h
qemu-bridge-helper.c
qemu-char.c
qemu-char.h
qemu-common.h Merge remote-tracking branch 'mjt/mjt-iov2' into staging 2012-07-09 12:35:06 -05:00
qemu-config.c
qemu-config.h
qemu-coroutine-int.h
qemu-coroutine-io.c
qemu-coroutine-lock.c
qemu-coroutine-sleep.c
qemu-coroutine.c
qemu-coroutine.h
qemu-doc.texi doc: Fix indefinite article an -> a before nouns that begin with 'h' 2012-07-17 15:40:14 -05:00
qemu-error.c
qemu-error.h
qemu-file.h
qemu-ga.c
qemu-img-cmds.hx
qemu-img.c
qemu-img.texi
qemu-io.c qemu-io: Fix memory leaks 2012-07-17 16:48:32 +02:00
qemu-lock.h
qemu-log.c qemu-log: fix x86 and user logging 2012-07-14 11:53:03 +00:00
qemu-log.h qemu-log: fix x86 and user logging 2012-07-14 11:53:03 +00:00
qemu-nbd.c
qemu-nbd.texi
qemu-objects.h
qemu-option-internal.h expose QemuOpt and QemuOpts struct definitions to interested parties 2012-07-23 11:55:17 +01:00
qemu-option.c expose QemuOpt and QemuOpts struct definitions to interested parties 2012-07-23 11:55:17 +01:00
qemu-option.h
qemu-options-wrapper.h
qemu-options.h
qemu-options.hx qemu-options.hx: Fix set_password and expire_password description 2012-07-17 15:40:15 -05:00
qemu-os-posix.h
qemu-os-win32.h
qemu-progress.c
qemu-queue.h
qemu-sockets.c
qemu-tech.texi doc: Fix indefinite article an -> a before nouns that begin with 'h' 2012-07-17 15:40:14 -05:00
qemu-thread-posix.c
qemu-thread-posix.h
qemu-thread-win32.c
qemu-thread-win32.h
qemu-thread.h
qemu-timer-common.c
qemu-timer.c
qemu-timer.h
qemu-tls.h
qemu-tool.c
qemu-user.c
qemu-x509.h
qemu-xattr.h
qemu.sasl
qerror.c
qerror.h
qfloat.c
qfloat.h
qint.c
qint.h
qjson.c
qjson.h
qlist.c
qlist.h
qmp-commands.hx qapi: Convert getfd and closefd 2012-07-13 13:46:55 -03:00
qmp.c
qobject.h
qstring.c
qstring.h
qtest.c
qtest.h
range.h
readline.c
readline.h
README
rules.mak
s390-dis.c
s390.ld
savevm.c No need to iterate if we already are over the limit 2012-06-29 13:27:28 +02:00
sh4-dis.c
softmmu_defs.h
softmmu_exec.h
softmmu_header.h
softmmu_template.h
softmmu-semi.h
sparc64.ld
sparc-dis.c
sparc.ld
spice-qemu-char.c
sysemu.h Add MigrationParams structure 2012-06-29 13:18:21 +02:00
targphys.h targphys.h: Define TARGET_PRI*PHYS format specifier macros 2012-07-14 10:35:48 +00:00
tcg-runtime.c
tci-dis.c
tci.c
thunk.c
thunk.h
TODO
trace-events Merge remote-tracking branch 'kwolf/for-anthony' into staging 2012-07-18 14:44:50 -05:00
translate-all.c
uboot_image.h
user-exec.c x86: avoid AREG0 for exceptions 2012-06-28 20:28:08 +00:00
VERSION
version.rc
vgafont.h
vl.c block: Geometry and translation hints are now useless, purge them 2012-07-17 16:48:31 +02:00
vmstate.h Add MigrationParams structure 2012-06-29 13:18:21 +02:00
x86_64.ld
xen-all.c memory: pass EventNotifier, not eventfd 2012-07-12 14:08:10 +03:00
xen-mapcache.c
xen-mapcache.h
xen-stub.c

Read the documentation in qemu-doc.html or on http://wiki.qemu.org

- QEMU team