History | View | Annotate | Download (20.2 kB)
qdev-monitor: set DeviceState opts before calling realize
Setting opts before the realize property is set allows thefollowing patch to make decisions based on whether the userspecified "rombar". This also avoids having to create a newtristate property especially for this purpose...
Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging
QOM infrastructure fixes and device conversions
Use error_is_set() only when necessary
error_is_set(&var) is the same as var != NULL, but it takeswhole-program analysis to figure that out. Unnecessarily hard foroptimizers, static checkers, and human readers. Dumb it down toobvious.
Gets rid of several dozen Coverity false positives....
qapi: Add human mode to StringOutputVisitor
This will be used by "info qtree". For numbers it prints both thedecimal and hex values. For sizes it rounds to the nearest powerof 2^10. For strings, it puts quotes around the string and separatesNULL and empty string....
qdev: Use human mode in "info qtree"
Reviewed-by: Igor Mammedov <imammedo@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
qdev: Inline qdev_prop_parse()
Merge remote branch 'luiz/queue/qmp' into qmpq
qemu-option: Remove qemu_opts_create_nofail
This is a boiler-plate _nofail variant of qemu_opts_create. Remove anduse error_abort in call sites.
null/0 arguments needs to be added for the id and fail_if_exists fieldsin affected callsites due to argument inconsistency between the normal and...
qdev-monitor: Improve error message for -device nonexistant
Once upon a time, the error message was:
qemu: -device nonexistant: Device "nonexistant" not found. Try -device '?' for a list.
But progress marches on, and conversion to QError (commit 0204276)...
qdev-monitor: Avoid device_add crashing on non-device driver name
Watch this:
$ upstream-qemu -nodefaults -S -display none -monitor stdio QEMU 1.7.50 monitor - type 'help' for more information (qemu) device_add rng-egd /work/armbru/qemu/qdev-monitor.c:491:qdev_device_add: Object 0x2089b00 is not an instance of type device...
qdev: Do not let the user try to device_add when it cannot work
Such devices have always been unavailable and omitted from the list ofavailable devices shown by device_add help. Until commit 18b6dadsilently broke the former, setting up nasty traps for unwary users,...
qdev: Replace no_user by cannot_instantiate_with_device_add_yet
In an ideal world, machines can be built by wiring devices togetherwith configuration, not code. Unfortunately, that's not the world welive in right now. We still have quite a few devices that need to be...
qdev-monitor: Avoid qdev as variable name
Prepares for bringing error cleanup code into canonical QOM form.
Includes a whitespace removal after curly brace by Stefan.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>Reviewed-by: Igor Mammedov <imammedo@redhat.com>...
qdev-monitor: Inline qdev_init() for device_add
For historic reasons, qdev_init() unparents the device on failure.Inline this to make the error paths clearer and consistent.
Reviewed-by: Igor Mammedov <imammedo@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
qdev: Drop misleading qdev_free() function
The qdev_free() function name is misleading since all the function doesis unlink the device from its parent. The device is not necessarilyfreed.
The device will be freed when its QObject refcount reaches zero. It is...
qdev-monitor: Unref device when device_add fails
qdev_device_add() leaks the created device upon failure. I suspect thisproblem crept in because qdev_free() unparents the device but does notdrop a reference - confusing name.
Cc: qemu-stable@nongnu.org...
qdev-monitor: Clean up qdev_device_add() variable naming
Avoid confusion between object (obj) and object class (oc).Tidy DeviceClass variable while at it (k -> dc).
Signed-off-by: Andreas Färber <afaerber@suse.de>
qdev-monitor: Fix crash when device_add is called with abstract driver
User is able to crash running QEMU when following monitorcommand is called:
device_add intel-hda-generic
Crash is caused by assertion in object_initialize_with_type()when type is abstract....
Mostly revert "qemu-help: Sort devices by logical functionality"
This reverts most of commit 3d1237fb2ab4edb926c717767bb5e31d6053a7c5.
The commit claims to sort the output of "-device help" "byfunctionality rather than alphabetical". Issues:
qdev-monitor: Group "device_add help" and "info qdm" by category
Output is a long, unsorted list. Not very helpful. Print one listper device category instead, with a header line identifying thecategory, plus a list of uncategorized devices. Print each list in...
qemu-help: Sort devices by logical functionality
Categorize devices that appear as output to "-device ?" commandby logical functionality. Sort the devices by logical categoriesbefore showing them to user.
The sort is done by functionality rather than alphabetical....
misc: Use g_assert_not_reached for code which is expected to be unreachable
The macro g_assert_not_reached is a better self documenting replacementfor assert(0) or assert(false).
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
qdev: Let qdev_prop_parse() pass through Error
Move error reporting to callers.
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>Signed-off-by: Andreas Färber <afaerber@suse.de>
qbus: remove wrong error messages
The existing code shows the "Bus '%s' is full" message even if nameis specified and different from bus->name (i.e. match=0).
The patch excludes unnecessary error message.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>...
qdev: Fix device_add bus assumptions
Drop an unreachable fallback bus assignment to SysBus.
If no ,bus= is specified, only search busses recursively for bus type ifthe DeviceClass has a bus_type specified. Handle resulting NULL cases.
Signed-off-by: Andreas Färber <afaerber@suse.de>...
hw: move qdev-monitor.o to toplevel directory
qdev-monitor.c is the only "core qdev" file that is not used inuser-mode emulation, and it does not define anything that is usedby hardware models. Remove it from the hw/ directory andremove hw/qdev-monitor.h from hw/qdev.h too; this requires...