Error API: Flag errors in *errp even if errors are being ignored
Subsystems (13)
RFC 2/15 error: New IGNORE_ERRORS macro
In reply to Eduardo HabkostDefine new IGNORE_ERRORS macro that should be used when errors will be ignored.
NULL will still work by now, but will break once we implement IGNORE_ERRORS in a different way later. Other patches will convert existing code to use IGNORE_ERRORS.
--- include/qapi/error.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
include/qapi/error.h +3 -1
@@ -66,7 +66,7 @@* } * * Call a function ignoring errors: -* foo(arg, NULL); +* foo(arg, IGNORE_ERRORS); * * Call a function aborting on errors: * foo(arg, &error_abort);
@@ -117,6 +117,8 @@#include "qapi-types.h" +#define IGNORE_ERRORS (NULL) +/* * Overall category of an error. * Based on the qapi type QapiErrorClass, but reproduced here for nicer
Signature · 1 line
2.11.0.259.g40922b1
RFC 1/15 tests: Test cases for error API
In reply to Eduardo Habkost--- tests/test-qapi-util.c | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++ tests/Makefile.include | 2 +- 2 files changed, 100 insertions(+), 1 deletion(-)
tests/test-qapi-util.c +99 -0
@@ -75,11 +75,110 @@ static void test_parse_qapi_name(void)g_assert (ret ==-1 ); } +static void successfn (Error **errp) +{ +g_assert (!errp || !*errp); +} + +static void fail1 (Error **errp) +{ +g_assert (!errp || !*errp); + +error_setg (errp,"error1" ); + +g_assert (!errp || *errp); +} + +static void fail2 (Error **errp) +{ +g_assert (!errp || !*errp); + +error_setg (errp,"error2" ); + +g_assert (!errp || *errp); +} + +static void multifn (Error **errp) +{ +Error *err1 =NULL , *err2 =NULL ; +successfn (&err1); +g_assert (!err1); + +fail1 (&err1); +g_assert (err1); + g_assert_cmpstr(error_get_pretty(err1), ==, "error1"); + +fail2 (&err2); +g_assert (err2); + g_assert_cmpstr(error_get_pretty(err2), ==, "error2"); + +error_propagate (&err1, err2); +g_assert (err1); + g_assert_cmpstr(error_get_pretty(err1), ==, "error1"); + +error_propagate (errp, err1); +} + +static void test_propagate (void (*fn)(Error **),Error **errp) +{ +bool failed; +Error *local_err =NULL ; + +g_assert (!errp || !*errp); + +fn (&local_err); + failed = !!local_err; +error_propagate (errp, local_err); + +g_assert (!errp || (failed == !!*errp)); +} + +static void test_error_api (void ) +{ +Error *err =NULL ; + +successfn (NULL ); +test_propagate (successfn,NULL ); + +fail1 (NULL ); +test_propagate (fail1,NULL ); + +multifn (NULL ); +test_propagate (multifn,NULL ); + +successfn (&err); +g_assert (!err); + +test_propagate (successfn, &err); +g_assert (!err); + +fail1 (&err); +g_assert (err); + g_assert_cmpstr(error_get_pretty(err), ==, "error1"); +error_free_or_abort (&err); + +test_propagate (fail1, &err); +g_assert (err); + g_assert_cmpstr(error_get_pretty(err), ==, "error1"); +error_free_or_abort (&err); + +multifn (&err); +g_assert (err); + g_assert_cmpstr(error_get_pretty(err), ==, "error1"); +error_free_or_abort (&err); + +test_propagate (multifn, &err); +g_assert (err); + g_assert_cmpstr(error_get_pretty(err), ==, "error1"); +error_free_or_abort (&err); +} +int main (int argc,char *argv[]) {g_test_init (&argc, &argv,NULL );g_test_add_func ("/qapi/util/qapi_enum_parse" , test_qapi_enum_parse);g_test_add_func ("/qapi/util/parse_qapi_name" , test_parse_qapi_name); +g_test_add_func ("/qapi/util/error" , test_error_api);g_test_run ();return 0 ; }
tests/Makefile.include +1 -1
@@ -129,7 +129,7 @@ check-unit-y += tests/test-uuid$(EXESUF) check-unit-y += tests/ptimer-test$(EXESUF) gcov-files-ptimer-test-y = hw/core/ptimer.c check-unit-y += tests/test-qapi-util$(EXESUF) -gcov-files-test-qapi-util-y = qapi/qapi-util.c +gcov-files-test-qapi-util-y = qapi/qapi-util.c qapi/error.c check-block-$(CONFIG_POSIX) += tests/qemu-iotests-quick.sh
Signature · 1 line
2.11.0.259.g40922b1
cover Error API: Flag errors in *errp even if errors are being ignored
Rationale
---------
I'm often bothered by the fact that we can't write the following:
foo(arg, errp);
if (*errp) {
handle the error...
error_propagate(errp, err);
}because errp can be NULL.
I understand the reason we need to support errp==NULL, as it makes life simpler for callers that don't want any extra error information. However, this has the cost of making the functions that report errors more complex and error-prone.
(Evidence of that: the 34 ERR_IS_* cases handled by the "use ERR_IS_* macros" patches in the series. Where existing code will crash or behave differently if errp is NULL.)
I considered suggesting forbidding NULL errp, and just changing all callers that use NULL to have an err variable and call error_free(), but this would mean changing 690 function callers that pass NULL errp as argument.
Here I'm proposing a mechanism to have the best of both worlds:
allow callers to ignore errors easily while allowing functions to propagate errors without an intermediate local_err variable.
The Proposal
------------
I'm proposing replacing NULL errp with a special macro:IGNORE_ERRORS. The macro will trigger special behavior in the error API that will make it not save any error information in the error pointer, but still keep track of boolean error state in *errp.
This will allow us to simplify the documented method to propagate errors from:
Error *err = NULL;
foo(arg, &err);
if (err) {
handle the error...
error_propagate(errp, err);
}to:
foo(arg, errp);
if (ERR_IS_SET(errp)) {
handle the error...
}This will allow us to stop using local_err variables and error_propagate() on hundreds of cases.
Implementation
--------------
This replaces NULL errp arguments on function calls with a IGNORE_ERRORS macro. Checks for (!errp) are replaced by ERR_IS_IGNORED(errp). Checks for (*errp) are replaced by ERR_IS_SET(errp). No extra changes are required on function callers.
Then IGNORE_ERRORS is implemend as:
(& { &ignored_error_unset })
When error_set() is called and IGNORE_ERRORS was used, we set error state using:
*errp = &ignored_error_set;
This way, we can make ERR_IS_SET work even if errp was IGNORE_ERRORS. The ERR_IS_* macros are reimplemented as:
#define ERR_IS_SET(e) (*(e) && *(e) != &ignored_error_unset) #define ERR_IS_IGNORED(e) (!(e) || *(e) == &ignored_error_unset || *(e) == &ignored_error_set)
Ensuring errp is never NULL
---------------------------
The last patch on this series changes the (Error **errp) parameters in functions to (Error *errp[static 1]), just to help validate the existing code, as clang warns about NULL arguments on that case. I don't think we should apply that patch, though, because the "[static 1]" syntax confuses Coccinelle.
I have a branch where I experimented with the idea of replacing (Error **errp) parameters with an opaque type (void*, or a struct type). I gave up when I noticed it would require touching all callers to replace &err with a wrapper macro to convert to the right type. Suggestions to make NULL errp easier to detect at build time are welcome.
(Probably the easiest solution for that is to add assert(errp) lines to the ERR_IS_*() macros.)
Desirable side-effects
----------------------
Some of additional benefits from parts of this series:
* Making code that ignore error information more visible and greppable (using IGNORE_ERRORS). I believe many of those cases are actually bugs and should use &error_abort or &error_fatal instead.
* Making code that depends on errp more visible and greppable (using ERR_IS_* macros). Some of those cases are also likely to be bugs, and need to be investigated.
TODO
----
* Simplify more cases of local_error/error_propagate() to use errp directly.
* Update API documentation and code examples.
* Add a mechanism to ensure errp is never NULL.
Git branch
----------
This series depend on a few extra cleanups that I didn't submit to qemu-devel yet. A git branch including this series is available at:
git://github.com/ehabkost/qemu-hacks.git work/err-api-rework-ignore-ptr-v1
Eduardo Habkost (15):
tests: Test cases for error API
error: New IGNORE_ERRORS macro
Add qapi/error.h includes on files that will need it [coccinelle] Use IGNORE_ERRORS instead of NULL as errp argument
qapi: Use IGNORE_ERRORS instead of NULL on generated code
test-qapi-util: Use IGNORE_ERRORS instead of NULL
Manual changes to use IGNORE_ERRORS instead of NULL
error: New ERR_IS_* macros for checking Error** values [coccinelle] Use ERR_IS_* macros
test-qapi-util: Use ERR_IS_* macros
Manual changes to use ERR_IS_* macros
error: Make IGNORED_ERRORS not a NULL pointer
rdma: Simplify var declaration to avoid confusing Coccinelle [coccinelle] Eliminate unnecessary local_err/error_propagate() usage [test only] Use 'Error *err[static 1]' instead of 'Error **errp' to
catch NULL errp arguments
include/qapi/visitor.h | 47 ++++--- scripts/qapi-commands.py | 6 +- scripts/qapi-types.py | 3 +- block/nbd-client.h | 2 +- block/qcow2.h | 8 +- block/vhdx.h | 2 +- crypto/blockpriv.h | 4 +- crypto/hmac.h | 10 +- crypto/tlscredspriv.h | 4 +- hw/9pfs/9p.h | 4 +- hw/block/dataplane/virtio-blk.h | 2 +- hw/s390x/s390-virtio.h | 2 +- hw/timer/m48t59-internal.h | 2 +- hw/usb/hcd-ehci.h | 4 +- hw/vfio/pci.h | 4 +- hw/xen/xen-host-pci-device.h | 2 +- hw/xen/xen_pt.h | 4 +- include/block/aio.h | 4 +- include/block/block.h | 69 ++++++---- include/block/block_backup.h | 2 +- include/block/block_int.h | 19 +-- include/block/blockjob.h | 11 +- include/block/blockjob_int.h | 3 +- include/block/dirty-bitmap.h | 8 +- include/block/nbd.h | 13 +- include/block/qapi.h | 7 +- include/block/snapshot.h | 12 +- include/chardev/char-fd.h | 2 +- include/chardev/char-fe.h | 4 +- include/chardev/char-win.h | 3 +- include/chardev/char.h | 9 +- include/crypto/afsplit.h | 4 +- include/crypto/block.h | 10 +- include/crypto/cipher.h | 8 +- include/crypto/hash.h | 12 +- include/crypto/init.h | 2 +- include/crypto/ivgen.h | 2 +- include/crypto/pbkdf.h | 4 +- include/crypto/random.h | 4 +- include/crypto/secret.h | 6 +- include/crypto/tlssession.h | 6 +- include/exec/memory.h | 12 +- include/exec/ram_addr.h | 12 +- include/hw/acpi/acpi.h | 4 +- include/hw/acpi/cpu.h | 7 +- include/hw/acpi/cpu_hotplug.h | 3 +- include/hw/acpi/ich9.h | 9 +- include/hw/acpi/memory_hotplug.h | 6 +- include/hw/acpi/pcihp.h | 4 +- include/hw/audio/pcspk.h | 3 +- include/hw/block/block.h | 4 +- include/hw/boards.h | 2 +- include/hw/char/serial.h | 2 +- include/hw/hotplug.h | 8 +- include/hw/i386/pc.h | 2 +- include/hw/isa/isa.h | 6 +- include/hw/loader.h | 3 +- include/hw/mem/pc-dimm.h | 10 +- include/hw/nmi.h | 2 +- include/hw/pci/msi.h | 2 +- include/hw/pci/msix.h | 4 +- include/hw/pci/pci.h | 2 +- include/hw/pci/pcie.h | 5 +- include/hw/pci/pcie_aer.h | 2 +- include/hw/pci/shpc.h | 5 +- include/hw/ppc/pnv_xscom.h | 2 +- include/hw/ppc/xics.h | 7 +- include/hw/qdev-core.h | 8 +- include/hw/qdev-properties.h | 10 +- include/hw/s390x/css.h | 4 +- include/hw/scsi/scsi.h | 3 +- include/hw/smbios/smbios.h | 2 +- include/hw/usb.h | 8 +- include/hw/vfio/vfio-common.h | 5 +- include/hw/virtio/vhost-scsi-common.h | 2 +- include/hw/virtio/virtio-bus.h | 2 +- include/hw/virtio/virtio-scsi.h | 6 +- include/hw/xen/xen.h | 2 +- include/io/channel-command.h | 2 +- include/io/channel-file.h | 2 +- include/io/channel-socket.h | 14 +- include/io/channel-tls.h | 4 +- include/io/channel-util.h | 2 +- include/io/channel.h | 20 +-- include/io/dns-resolver.h | 2 +- include/io/task.h | 2 +- include/migration/blocker.h | 2 +- include/migration/failover.h | 2 +- include/migration/migration.h | 4 +- include/migration/snapshot.h | 4 +- include/migration/vmstate.h | 5 +- include/monitor/monitor.h | 6 +- include/monitor/qdev.h | 4 +- include/net/net.h | 6 +- include/qapi/error.h | 23 +++- include/qapi/qmp/json-parser.h | 3 +- include/qapi/qmp/qdict.h | 2 +- include/qapi/qmp/qjson.h | 5 +- include/qapi/qobject-input-visitor.h | 2 +- include/qapi/util.h | 2 +- include/qemu/base64.h | 2 +- include/qemu/config-file.h | 4 +- include/qemu/log.h | 4 +- include/qemu/main-loop.h | 2 +- include/qemu/option.h | 30 ++-- include/qemu/sockets.h | 33 +++-- include/qemu/throttle.h | 2 +- include/qom/cpu.h | 4 +- include/qom/object.h | 89 ++++++------ include/qom/object_interfaces.h | 12 +- include/qom/qom-qobject.h | 4 +- include/sysemu/arch_init.h | 8 +- include/sysemu/block-backend.h | 19 +-- include/sysemu/cpus.h | 4 +- include/sysemu/cryptodev.h | 8 +- include/sysemu/device_tree.h | 6 +- include/sysemu/hostmem.h | 2 +- include/sysemu/memory_mapping.h | 2 +- include/sysemu/numa.h | 5 +- include/sysemu/qtest.h | 3 +- include/sysemu/sysemu.h | 10 +- include/sysemu/tpm_backend.h | 2 +- include/ui/console.h | 14 +- include/ui/input.h | 2 +- include/ui/qemu-spice.h | 2 +- migration/block.h | 2 +- migration/exec.h | 5 +- migration/fd.h | 4 +- migration/rdma.h | 5 +- migration/savevm.h | 2 +- migration/socket.h | 9 +- migration/tls.h | 4 +- nbd/nbd-internal.h | 6 +- net/clients.h | 20 +-- net/tap_int.h | 5 +- qga/guest-agent-core.h | 4 +- qga/vss-win32.h | 2 +- replication.h | 8 +- target/i386/cpu.h | 2 +- target/ppc/cpu.h | 5 +- target/s390x/cpu.h | 10 +- target/s390x/cpu_models.h | 9 +- qapi/qapi-visit-core.c | 64 +++++---- arch_init.c | 2 +- backends/cryptodev-builtin.c | 15 +- backends/cryptodev.c | 24 ++-- backends/hostmem-file.c | 11 +- backends/hostmem-ram.c | 2 +- backends/hostmem.c | 45 +++--- backends/rng-egd.c | 9 +- backends/rng-random.c | 8 +- backends/rng.c | 15 +- backends/tpm.c | 15 +- balloon.c | 6 +- block.c | 150 ++++++++++---------- block/backup.c | 13 +- block/blkdebug.c | 33 +++-- block/blkreplay.c | 2 +- block/blkverify.c | 4 +- block/block-backend.c | 31 +++-- block/bochs.c | 4 +- block/cloop.c | 4 +- block/commit.c | 35 +++-- block/crypto.c | 32 ++--- block/curl.c | 10 +- block/dirty-bitmap.c | 9 +- block/dmg.c | 6 +- block/file-posix.c | 52 +++---- block/file-win32.c | 18 +-- block/gluster.c | 23 ++-- block/io.c | 13 +- block/iscsi.c | 58 ++++---- block/mirror.c | 30 ++-- block/nbd-client.c | 12 +- block/nbd.c | 36 +++-- block/nfs.c | 37 ++--- block/null.c | 4 +- block/parallels.c | 12 +- block/qapi.c | 19 ++- block/qcow.c | 15 +- block/qcow2-cluster.c | 2 +- block/qcow2-refcount.c | 8 +- block/qcow2-snapshot.c | 4 +- block/qcow2.c | 44 +++--- block/qed.c | 21 +-- block/quorum.c | 11 +- block/raw-format.c | 20 +-- block/rbd.c | 29 ++-- block/replication.c | 46 +++---- block/sheepdog.c | 65 ++++----- block/snapshot.c | 14 +- block/ssh.c | 43 +++--- block/stream.c | 10 +- block/vdi.c | 7 +- block/vhdx-log.c | 4 +- block/vhdx.c | 13 +- block/vmdk.c | 33 +++-- block/vpc.c | 11 +- block/vvfat.c | 12 +- block/vxhs.c | 6 +- block/write-threshold.c | 2 +- blockdev-nbd.c | 13 +- blockdev.c | 184 ++++++++++++------------- blockjob.c | 35 +++-- bootdevice.c | 27 ++-- bsd-user/elfload.c | 4 +- chardev/baum.c | 2 +- chardev/char-console.c | 2 +- chardev/char-fd.c | 4 +- chardev/char-fe.c | 4 +- chardev/char-file.c | 4 +- chardev/char-io.c | 3 +- chardev/char-mux.c | 4 +- chardev/char-null.c | 2 +- chardev/char-parallel.c | 8 +- chardev/char-pipe.c | 8 +- chardev/char-pty.c | 4 +- chardev/char-ringbuf.c | 8 +- chardev/char-serial.c | 6 +- chardev/char-socket.c | 30 ++-- chardev/char-stdio.c | 4 +- chardev/char-udp.c | 8 +- chardev/char-win-stdio.c | 2 +- chardev/char-win.c | 3 +- chardev/char.c | 25 ++-- chardev/msmouse.c | 2 +- chardev/spice.c | 8 +- chardev/wctablet.c | 2 +- cpus.c | 12 +- crypto/afsplit.c | 6 +- crypto/block-luks.c | 22 +-- crypto/block-qcow.c | 10 +- crypto/block.c | 14 +- crypto/cipher-builtin.c | 24 ++-- crypto/cipher-gcrypt.c | 8 +- crypto/cipher-nettle.c | 8 +- crypto/cipher.c | 2 +- crypto/hash-gcrypt.c | 2 +- crypto/hash-glib.c | 2 +- crypto/hash-nettle.c | 2 +- crypto/hash.c | 10 +- crypto/hmac-gcrypt.c | 4 +- crypto/hmac-glib.c | 8 +- crypto/hmac-nettle.c | 4 +- crypto/hmac.c | 6 +- crypto/init.c | 2 +- crypto/ivgen-essiv.c | 4 +- crypto/ivgen-plain.c | 4 +- crypto/ivgen-plain64.c | 4 +- crypto/ivgen.c | 4 +- crypto/pbkdf-gcrypt.c | 2 +- crypto/pbkdf-nettle.c | 2 +- crypto/pbkdf-stub.c | 2 +- crypto/pbkdf.c | 4 +- crypto/random-gcrypt.c | 4 +- crypto/random-gnutls.c | 4 +- crypto/random-platform.c | 4 +- crypto/secret.c | 50 +++---- crypto/tlscreds.c | 28 ++-- crypto/tlscredsanon.c | 14 +- crypto/tlscredsx509.c | 44 +++--- crypto/tlssession.c | 18 +-- device_tree.c | 8 +- dump.c | 207 ++++++++++------------------ exec.c | 40 +++--- fsdev/qemu-fsdev-throttle.c | 3 +- gdbstub.c | 2 +- hmp.c | 68 ++++----- hw/9pfs/9p.c | 4 +- hw/9pfs/virtio-9p-device.c | 7 +- hw/9pfs/xen-9p-backend.c | 12 +- hw/acpi/acpi-stub.c | 2 +- hw/acpi/core.c | 6 +- hw/acpi/cpu.c | 9 +- hw/acpi/cpu_hotplug.c | 7 +- hw/acpi/ich9.c | 51 +++---- hw/acpi/memory_hotplug.c | 19 +-- hw/acpi/nvdimm.c | 17 +-- hw/acpi/pcihp.c | 4 +- hw/acpi/piix4.c | 28 ++-- hw/acpi/vmgenid.c | 12 +- hw/arm/allwinner-a10.c | 30 ++-- hw/arm/armv7m.c | 30 ++-- hw/arm/aspeed.c | 4 +- hw/arm/aspeed_soc.c | 25 ++-- hw/arm/bcm2835_peripherals.c | 33 +++-- hw/arm/bcm2836.c | 5 +- hw/arm/digic.c | 30 ++-- hw/arm/exynos4210.c | 2 +- hw/arm/fsl-imx25.c | 63 ++++----- hw/arm/fsl-imx31.c | 58 ++++---- hw/arm/fsl-imx6.c | 110 +++++++-------- hw/arm/highbank.c | 2 +- hw/arm/integratorcp.c | 4 +- hw/arm/musicpal.c | 4 +- hw/arm/pxa2xx.c | 2 +- hw/arm/pxa2xx_gpio.c | 2 +- hw/arm/realview.c | 2 +- hw/arm/spitz.c | 4 +- hw/arm/stm32f205_soc.c | 2 +- hw/arm/strongarm.c | 2 +- hw/arm/tosa.c | 2 +- hw/arm/versatilepb.c | 2 +- hw/arm/vexpress.c | 13 +- hw/arm/virt.c | 62 +++++---- hw/arm/xilinx_zynq.c | 2 +- hw/arm/xlnx-zynqmp.c | 14 +- hw/arm/z2.c | 2 +- hw/audio/ac97.c | 2 +- hw/audio/adlib.c | 2 +- hw/audio/cs4231a.c | 2 +- hw/audio/es1370.c | 2 +- hw/audio/gus.c | 2 +- hw/audio/intel-hda.c | 6 +- hw/audio/marvell_88w8618.c | 2 +- hw/audio/milkymist-ac97.c | 2 +- hw/audio/pcspk.c | 2 +- hw/audio/pl041.c | 2 +- hw/audio/sb16.c | 2 +- hw/block/block.c | 4 +- hw/block/dataplane/virtio-blk.c | 2 +- hw/block/fdc.c | 37 ++--- hw/block/m25p80.c | 2 +- hw/block/nand.c | 2 +- hw/block/nvme.c | 2 +- hw/block/pflash_cfi01.c | 8 +- hw/block/pflash_cfi02.c | 8 +- hw/block/virtio-blk.c | 27 ++-- hw/bt/hci-csr.c | 2 +- hw/char/bcm2835_aux.c | 2 +- hw/char/cadence_uart.c | 2 +- hw/char/debugcon.c | 10 +- hw/char/digic-uart.c | 2 +- hw/char/escc.c | 2 +- hw/char/etraxfs_ser.c | 2 +- hw/char/exynos4210_uart.c | 2 +- hw/char/imx_serial.c | 2 +- hw/char/ipoctal232.c | 2 +- hw/char/lm32_juart.c | 2 +- hw/char/lm32_uart.c | 2 +- hw/char/mcf_uart.c | 2 +- hw/char/milkymist-uart.c | 2 +- hw/char/parallel.c | 2 +- hw/char/pl011.c | 2 +- hw/char/serial-isa.c | 2 +- hw/char/serial-pci.c | 16 +-- hw/char/serial.c | 2 +- hw/char/spapr_vty.c | 2 +- hw/char/stm32f2xx_usart.c | 2 +- hw/char/terminal3270.c | 2 +- hw/char/virtio-console.c | 4 +- hw/char/virtio-serial-bus.c | 22 +-- hw/char/xilinx_uartlite.c | 2 +- hw/core/bus.c | 19 +-- hw/core/generic-loader.c | 4 +- hw/core/hotplug.c | 8 +- hw/core/loader.c | 3 +- hw/core/machine.c | 99 +++++++------ hw/core/nmi.c | 2 +- hw/core/or-irq.c | 2 +- hw/core/platform-bus.c | 8 +- hw/core/qdev-properties-system.c | 52 +++---- hw/core/qdev-properties.c | 112 +++++++-------- hw/core/qdev.c | 61 ++++---- hw/core/sysbus.c | 6 +- hw/cpu/a15mpcore.c | 10 +- hw/cpu/a9mpcore.c | 30 ++-- hw/cpu/arm11mpcore.c | 23 ++-- hw/cpu/core.c | 24 ++-- hw/cpu/realview_mpcore.c | 13 +- hw/display/ads7846.c | 2 +- hw/display/bcm2835_fb.c | 2 +- hw/display/cg3.c | 2 +- hw/display/cirrus_vga.c | 4 +- hw/display/exynos4210_fimd.c | 2 +- hw/display/jazz_led.c | 2 +- hw/display/milkymist-tmu2.c | 2 +- hw/display/milkymist-vgafb.c | 2 +- hw/display/pl110.c | 2 +- hw/display/qxl.c | 12 +- hw/display/sm501.c | 4 +- hw/display/ssd0323.c | 2 +- hw/display/tcx.c | 2 +- hw/display/vga-isa.c | 2 +- hw/display/vga-pci.c | 16 ++- hw/display/virtio-gpu-pci.c | 3 +- hw/display/virtio-gpu.c | 14 +- hw/display/virtio-vga.c | 9 +- hw/display/vmware_vga.c | 2 +- hw/display/xlnx_dp.c | 4 +- hw/dma/bcm2835_dma.c | 2 +- hw/dma/i82374.c | 2 +- hw/dma/i8257.c | 2 +- hw/dma/pl330.c | 2 +- hw/dma/pxa2xx_dma.c | 2 +- hw/dma/rc4030.c | 4 +- hw/dma/sparc32_dma.c | 2 +- hw/dma/xilinx_axidma.c | 2 +- hw/gpio/bcm2835_gpio.c | 2 +- hw/gpio/gpio_key.c | 2 +- hw/gpio/imx_gpio.c | 2 +- hw/gpio/omap_gpio.c | 4 +- hw/i2c/aspeed_i2c.c | 2 +- hw/i2c/imx_i2c.c | 2 +- hw/i2c/omap_i2c.c | 2 +- hw/i2c/smbus_ich9.c | 2 +- hw/i386/acpi-build.c | 51 ++++--- hw/i386/amd_iommu.c | 2 +- hw/i386/intel_iommu.c | 4 +- hw/i386/kvm/apic.c | 4 +- hw/i386/kvm/clock.c | 2 +- hw/i386/kvm/i8254.c | 2 +- hw/i386/kvm/i8259.c | 2 +- hw/i386/kvm/ioapic.c | 2 +- hw/i386/kvm/pci-assign.c | 29 ++-- hw/i386/kvmvapic.c | 2 +- hw/i386/pc.c | 84 ++++++----- hw/i386/pc_q35.c | 16 ++- hw/i386/x86-iommu.c | 2 +- hw/i386/xen/xen-hvm.c | 4 +- hw/i386/xen/xen_apic.c | 2 +- hw/i386/xen/xen_platform.c | 2 +- hw/i386/xen/xen_pvdevice.c | 2 +- hw/ide/ahci.c | 2 +- hw/ide/cmd646.c | 2 +- hw/ide/core.c | 2 +- hw/ide/ich.c | 5 +- hw/ide/isa.c | 2 +- hw/ide/macio.c | 2 +- hw/ide/microdrive.c | 2 +- hw/ide/mmio.c | 2 +- hw/ide/piix.c | 2 +- hw/ide/qdev.c | 12 +- hw/ide/via.c | 2 +- hw/input/adb.c | 6 +- hw/input/pckbd.c | 2 +- hw/input/virtio-input-hid.c | 9 +- hw/input/virtio-input-host.c | 5 +- hw/input/virtio-input.c | 20 ++- hw/input/vmmouse.c | 2 +- hw/intc/apic.c | 4 +- hw/intc/apic_common.c | 18 ++- hw/intc/arm_gic.c | 8 +- hw/intc/arm_gic_common.c | 2 +- hw/intc/arm_gic_kvm.c | 13 +- hw/intc/arm_gicv2m.c | 2 +- hw/intc/arm_gicv3.c | 8 +- hw/intc/arm_gicv3_common.c | 5 +- hw/intc/arm_gicv3_its_kvm.c | 8 +- hw/intc/arm_gicv3_kvm.c | 13 +- hw/intc/armv7m_nvic.c | 8 +- hw/intc/aspeed_vic.c | 2 +- hw/intc/exynos4210_gic.c | 3 +- hw/intc/grlib_irqmp.c | 2 +- hw/intc/i8259.c | 2 +- hw/intc/i8259_common.c | 2 +- hw/intc/ioapic.c | 2 +- hw/intc/ioapic_common.c | 2 +- hw/intc/mips_gic.c | 2 +- hw/intc/nios2_iic.c | 2 +- hw/intc/omap_intc.c | 4 +- hw/intc/openpic.c | 2 +- hw/intc/openpic_kvm.c | 2 +- hw/intc/realview_gic.c | 8 +- hw/intc/s390_flic.c | 4 +- hw/intc/s390_flic_kvm.c | 5 +- hw/intc/xics.c | 8 +- hw/intc/xics_kvm.c | 8 +- hw/intc/xics_pnv.c | 2 +- hw/intc/xics_spapr.c | 5 +- hw/ipack/ipack.c | 8 +- hw/ipack/tpci200.c | 2 +- hw/ipmi/ipmi.c | 5 +- hw/ipmi/ipmi_bmc_extern.c | 2 +- hw/ipmi/ipmi_bmc_sim.c | 2 +- hw/ipmi/isa_ipmi_bt.c | 6 +- hw/ipmi/isa_ipmi_kcs.c | 4 +- hw/isa/i82378.c | 2 +- hw/isa/isa-bus.c | 2 +- hw/isa/lpc_ich9.c | 13 +- hw/isa/pc87312.c | 2 +- hw/isa/piix4.c | 2 +- hw/isa/vt82c686.c | 8 +- hw/mem/nvdimm.c | 8 +- hw/mem/pc-dimm.c | 24 ++-- hw/microblaze/petalogix_ml605_mmu.c | 14 +- hw/mips/boston.c | 2 +- hw/mips/cps.c | 2 +- hw/mips/gt64xxx_pci.c | 2 +- hw/mips/mips_malta.c | 3 +- hw/misc/applesmc.c | 2 +- hw/misc/arm11scu.c | 2 +- hw/misc/arm_sysctl.c | 2 +- hw/misc/aspeed_scu.c | 2 +- hw/misc/aspeed_sdmc.c | 2 +- hw/misc/auxbus.c | 3 +- hw/misc/bcm2835_mbox.c | 2 +- hw/misc/bcm2835_property.c | 2 +- hw/misc/debugexit.c | 2 +- hw/misc/eccmemctl.c | 2 +- hw/misc/edu.c | 7 +- hw/misc/hyperv_testdev.c | 2 +- hw/misc/imx6_src.c | 2 +- hw/misc/ivshmem.c | 49 ++++--- hw/misc/macio/cuda.c | 2 +- hw/misc/macio/macio.c | 45 +++--- hw/misc/max111x.c | 4 +- hw/misc/mips_cmgcr.c | 2 +- hw/misc/mips_cpc.c | 2 +- hw/misc/mips_itu.c | 2 +- hw/misc/pc-testdev.c | 2 +- hw/misc/pci-testdev.c | 2 +- hw/misc/pvpanic.c | 5 +- hw/misc/sga.c | 2 +- hw/misc/tmp105.c | 12 +- hw/misc/unimp.c | 2 +- hw/misc/vmport.c | 2 +- hw/net/allwinner_emac.c | 2 +- hw/net/cadence_gem.c | 2 +- hw/net/dp8393x.c | 8 +- hw/net/e1000.c | 5 +- hw/net/e1000e.c | 11 +- hw/net/eepro100.c | 5 +- hw/net/fsl_etsec/etsec.c | 2 +- hw/net/ftgmac100.c | 2 +- hw/net/imx_fec.c | 2 +- hw/net/lance.c | 3 +- hw/net/mcf_fec.c | 2 +- hw/net/ne2000-isa.c | 10 +- hw/net/ne2000.c | 5 +- hw/net/pcnet-pci.c | 5 +- hw/net/rocker/qmp-norocker.c | 9 +- hw/net/rocker/rocker.c | 5 +- hw/net/rocker/rocker_of_dpa.c | 2 +- hw/net/rtl8139.c | 5 +- hw/net/spapr_llan.c | 5 +- hw/net/virtio-net.c | 10 +- hw/net/vmxnet3.c | 11 +- hw/net/xilinx_axienet.c | 2 +- hw/net/xilinx_ethlite.c | 2 +- hw/nvram/fw_cfg.c | 21 ++- hw/nvram/mac_nvram.c | 4 +- hw/nvram/spapr_nvram.c | 2 +- hw/pci-bridge/dec.c | 4 +- hw/pci-bridge/gen_pcie_root_port.c | 2 +- hw/pci-bridge/ioh3420.c | 2 +- hw/pci-bridge/pci_bridge_dev.c | 4 +- hw/pci-bridge/pci_expander_bridge.c | 16 +-- hw/pci-bridge/pcie_root_port.c | 2 +- hw/pci-host/apb.c | 4 +- hw/pci-host/bonito.c | 2 +- hw/pci-host/gpex.c | 5 +- hw/pci-host/grackle.c | 2 +- hw/pci-host/piix.c | 28 ++-- hw/pci-host/ppce500.c | 2 +- hw/pci-host/prep.c | 6 +- hw/pci-host/q35.c | 39 +++--- hw/pci-host/uninorth.c | 9 +- hw/pci-host/versatile.c | 4 +- hw/pci-host/xilinx-pcie.c | 7 +- hw/pci/msi.c | 2 +- hw/pci/msix.c | 4 +- hw/pci/pci-stub.c | 2 +- hw/pci/pci.c | 44 +++--- hw/pci/pcie.c | 10 +- hw/pci/pcie_aer.c | 2 +- hw/pci/shpc.c | 22 ++- hw/pcmcia/pxa2xx.c | 3 +- hw/ppc/e500.c | 11 +- hw/ppc/mac_newworld.c | 2 +- hw/ppc/mac_oldworld.c | 2 +- hw/ppc/pnv.c | 52 +++---- hw/ppc/pnv_core.c | 25 ++-- hw/ppc/pnv_lpc.c | 2 +- hw/ppc/pnv_occ.c | 2 +- hw/ppc/pnv_psi.c | 5 +- hw/ppc/pnv_xscom.c | 2 +- hw/ppc/prep.c | 9 +- hw/ppc/prep_systemio.c | 2 +- hw/ppc/rs6000_mc.c | 2 +- hw/ppc/spapr.c | 89 ++++++------ hw/ppc/spapr_cpu_core.c | 9 +- hw/ppc/spapr_drc.c | 66 +++++---- hw/ppc/spapr_hcall.c | 2 +- hw/ppc/spapr_iommu.c | 7 +- hw/ppc/spapr_pci.c | 30 ++-- hw/ppc/spapr_rng.c | 6 +- hw/ppc/spapr_rtc.c | 9 +- hw/ppc/spapr_vio.c | 2 +- hw/s390x/3270-ccw.c | 2 +- hw/s390x/ccw-device.c | 2 +- hw/s390x/css-bridge.c | 8 +- hw/s390x/css.c | 18 ++- hw/s390x/event-facility.c | 12 +- hw/s390x/ipl.c | 7 +- hw/s390x/s390-ccw.c | 7 +- hw/s390x/s390-pci-bus.c | 20 +-- hw/s390x/s390-skeys.c | 16 ++- hw/s390x/s390-virtio-ccw.c | 49 +++---- hw/s390x/s390-virtio.c | 4 +- hw/s390x/sclp.c | 9 +- hw/s390x/virtio-ccw.c | 61 ++++---- hw/scsi/esp-pci.c | 10 +- hw/scsi/esp.c | 2 +- hw/scsi/lsi53c895a.c | 4 +- hw/scsi/megasas.c | 4 +- hw/scsi/mptsas.c | 2 +- hw/scsi/scsi-bus.c | 34 ++--- hw/scsi/scsi-disk.c | 24 ++-- hw/scsi/scsi-generic.c | 2 +- hw/scsi/spapr_vscsi.c | 2 +- hw/scsi/vhost-scsi-common.c | 2 +- hw/scsi/vhost-scsi.c | 17 +-- hw/scsi/virtio-scsi-dataplane.c | 2 +- hw/scsi/virtio-scsi.c | 22 +-- hw/scsi/vmw_pvscsi.c | 10 +- hw/sd/pl181.c | 2 +- hw/sd/sd.c | 4 +- hw/sd/sdhci.c | 4 +- hw/sd/ssi-sd.c | 2 +- hw/sh4/sh_pci.c | 2 +- hw/smbios/smbios-stub.c | 2 +- hw/smbios/smbios.c | 2 +- hw/sparc/sun4m.c | 4 +- hw/sparc64/sun4u.c | 6 +- hw/ssi/aspeed_smc.c | 2 +- hw/ssi/imx_spi.c | 2 +- hw/ssi/ssi.c | 2 +- hw/ssi/xilinx_spips.c | 4 +- hw/timer/a9gtimer.c | 2 +- hw/timer/altera_timer.c | 2 +- hw/timer/arm_mptimer.c | 2 +- hw/timer/arm_timer.c | 2 +- hw/timer/aspeed_timer.c | 2 +- hw/timer/hpet.c | 2 +- hw/timer/i8254.c | 2 +- hw/timer/i8254_common.c | 2 +- hw/timer/imx_epit.c | 2 +- hw/timer/imx_gpt.c | 2 +- hw/timer/lm32_timer.c | 2 +- hw/timer/m48t59-isa.c | 2 +- hw/timer/m48t59.c | 4 +- hw/timer/mc146818rtc.c | 14 +- hw/timer/milkymist-sysctl.c | 2 +- hw/timer/pxa2xx_timer.c | 2 +- hw/timer/xilinx_timer.c | 2 +- hw/tpm/tpm_tis.c | 2 +- hw/usb/bus.c | 64 ++++----- hw/usb/dev-audio.c | 4 +- hw/usb/dev-bluetooth.c | 4 +- hw/usb/dev-hid.c | 13 +- hw/usb/dev-hub.c | 4 +- hw/usb/dev-mtp.c | 2 +- hw/usb/dev-network.c | 6 +- hw/usb/dev-serial.c | 8 +- hw/usb/dev-smartcard-reader.c | 4 +- hw/usb/dev-storage.c | 18 +-- hw/usb/dev-uas.c | 4 +- hw/usb/dev-wacom.c | 4 +- hw/usb/hcd-ehci-pci.c | 7 +- hw/usb/hcd-ehci-sysbus.c | 2 +- hw/usb/hcd-ehci.c | 6 +- hw/usb/hcd-ohci.c | 18 +-- hw/usb/hcd-uhci.c | 10 +- hw/usb/hcd-xhci.c | 4 +- hw/usb/host-libusb.c | 6 +- hw/usb/redirect.c | 6 +- hw/vfio/amd-xgbe.c | 2 +- hw/vfio/calxeda-xgmac.c | 2 +- hw/vfio/ccw.c | 14 +- hw/vfio/common.c | 7 +- hw/vfio/pci-quirks.c | 6 +- hw/vfio/pci.c | 35 +++-- hw/vfio/platform.c | 9 +- hw/virtio/vhost-vsock.c | 8 +- hw/virtio/virtio-balloon.c | 25 ++-- hw/virtio/virtio-bus.c | 2 +- hw/virtio/virtio-crypto-pci.c | 5 +- hw/virtio/virtio-crypto.c | 12 +- hw/virtio/virtio-mmio.c | 2 +- hw/virtio/virtio-pci.c | 48 ++++--- hw/virtio/virtio-rng.c | 20 +-- hw/virtio/virtio.c | 24 ++-- hw/watchdog/watchdog.c | 3 +- hw/watchdog/wdt_aspeed.c | 2 +- hw/watchdog/wdt_diag288.c | 4 +- hw/watchdog/wdt_i6300esb.c | 2 +- hw/watchdog/wdt_ib700.c | 2 +- hw/xen/xen-host-pci-device.c | 12 +- hw/xen/xen_backend.c | 4 +- hw/xen/xen_pt.c | 2 +- hw/xen/xen_pt_config_init.c | 4 +- hw/xen/xen_pt_graphics.c | 2 +- hw/xen/xen_pvdev.c | 3 +- io/channel-buffer.c | 10 +- io/channel-command.c | 16 +-- io/channel-file.c | 12 +- io/channel-socket.c | 30 ++-- io/channel-tls.c | 18 +-- io/channel-util.c | 2 +- io/channel-websock.c | 26 ++-- io/channel.c | 20 +-- io/dns-resolver.c | 6 +- io/task.c | 2 +- iothread.c | 8 +- linux-user/elfload.c | 4 +- linux-user/uname.c | 3 +- memory.c | 21 +-- memory_mapping.c | 2 +- migration/block.c | 3 +- migration/colo-failover.c | 4 +- migration/colo.c | 38 +++-- migration/exec.c | 5 +- migration/fd.c | 5 +- migration/migration.c | 43 +++--- migration/qemu-file-channel.c | 11 +- migration/ram.c | 4 +- migration/rdma.c | 40 +++--- migration/savevm.c | 14 +- migration/socket.c | 18 +-- migration/tls.c | 6 +- monitor.c | 57 ++++---- nbd/client.c | 29 ++-- nbd/common.c | 2 +- nbd/server.c | 22 +-- net/colo-compare.c | 25 ++-- net/dump.c | 19 +-- net/filter-buffer.c | 11 +- net/filter-mirror.c | 22 +-- net/filter-rewriter.c | 2 +- net/filter.c | 30 ++-- net/hub.c | 2 +- net/l2tpv3.c | 2 +- net/net.c | 31 +++-- net/netmap.c | 5 +- net/slirp.c | 2 +- net/socket.c | 2 +- net/tap-bsd.c | 10 +- net/tap-linux.c | 5 +- net/tap-solaris.c | 7 +- net/tap-stub.c | 5 +- net/tap-win32.c | 2 +- net/tap.c | 21 ++- net/vde.c | 2 +- net/vhost-user.c | 7 +- numa.c | 21 +-- qapi/opts-visitor.c | 28 ++-- qapi/qapi-clone-visitor.c | 20 +-- qapi/qapi-dealloc-visitor.c | 22 +-- qapi/qapi-util.c | 2 +- qapi/qmp-dispatch.c | 5 +- qapi/qobject-input-visitor.c | 50 ++++--- qapi/qobject-output-visitor.c | 20 +-- qapi/string-input-visitor.c | 25 ++-- qapi/string-output-visitor.c | 14 +- qdev-monitor.c | 35 +++-- qemu-img.c | 28 ++-- qemu-io.c | 2 +- qemu-nbd.c | 7 +- qga/commands-posix.c | 222 ++++++++++++++---------------- qga/commands-win32.c | 101 +++++++------- qga/commands.c | 16 +-- qga/main.c | 4 +- qga/vss-win32.c | 2 +- qmp.c | 87 ++++++------ qobject/json-parser.c | 5 +- qobject/qdict.c | 4 +- qobject/qjson.c | 5 +- qom/container.c | 3 +- qom/cpu.c | 10 +- qom/object.c | 237 +++++++++++++++----------------- qom/object_interfaces.c | 15 +- qom/qom-qobject.c | 4 +- qtest.c | 3 +- replication.c | 32 ++--- stubs/arch-query-cpu-def.c | 2 +- stubs/arch-query-cpu-model-baseline.c | 2 +- stubs/arch-query-cpu-model-comparison.c | 2 +- stubs/arch-query-cpu-model-expansion.c | 2 +- stubs/migr-blocker.c | 2 +- stubs/monitor.c | 2 +- stubs/uuid.c | 2 +- stubs/vmgenid.c | 2 +- stubs/vmstate.c | 2 +- stubs/xen-hvm.c | 4 +- target/alpha/cpu.c | 10 +- target/arm/cpu.c | 8 +- target/arm/cpu64.c | 9 +- target/arm/helper.c | 2 +- target/arm/monitor.c | 2 +- target/cris/cpu.c | 8 +- target/hppa/cpu.c | 10 +- target/i386/arch_memory_mapping.c | 2 +- target/i386/cpu.c | 133 +++++++++--------- target/lm32/cpu.c | 8 +- target/m68k/cpu.c | 8 +- target/m68k/helper.c | 3 +- target/microblaze/cpu.c | 8 +- target/microblaze/translate.c | 3 +- target/mips/cpu.c | 8 +- target/mips/translate.c | 3 +- target/moxie/cpu.c | 8 +- target/nios2/cpu.c | 10 +- target/openrisc/cpu.c | 8 +- target/ppc/compat.c | 5 +- target/ppc/kvm.c | 4 +- target/ppc/translate_init.c | 35 ++--- target/s390x/cpu.c | 14 +- target/s390x/cpu_models.c | 79 ++++++----- target/s390x/helper.c | 7 +- target/s390x/kvm.c | 10 +- target/sh4/cpu.c | 8 +- target/sparc/cpu.c | 14 +- target/tilegx/cpu.c | 10 +- target/tricore/cpu.c | 8 +- target/unicore32/cpu.c | 8 +- target/xtensa/cpu.c | 8 +- target/xtensa/helper.c | 3 +- tests/check-qom-proplist.c | 29 ++-- tests/io-channel-helpers.c | 4 +- tests/test-char.c | 2 +- tests/test-crypto-block.c | 6 +- tests/test-crypto-hash.c | 3 +- tests/test-crypto-tlscredsx509.c | 4 +- tests/test-crypto-tlssession.c | 2 +- tests/test-io-channel-socket.c | 2 +- tests/test-io-channel-tls.c | 13 +- tests/test-logging.c | 3 +- tests/test-qapi-util.c | 101 +++++++++++++- tests/test-qdev-global-props.c | 9 +- tests/test-qemu-opts.c | 6 +- tests/test-qmp-commands.c | 17 +-- tests/test-qmp-event.c | 3 +- tests/test-string-input-visitor.c | 12 +- tests/test-visitor-serialization.c | 25 ++-- tpm.c | 10 +- trace/qmp.c | 8 +- ui/console.c | 12 +- ui/gtk.c | 15 +- ui/input-legacy.c | 2 +- ui/input-linux.c | 20 +-- ui/input.c | 6 +- ui/spice-core.c | 7 +- ui/vnc-auth-sasl.c | 6 +- ui/vnc.c | 38 ++--- util/aio-posix.c | 3 +- util/aio-win32.c | 3 +- util/async.c | 2 +- util/base64.c | 2 +- util/error.c | 29 ++-- util/keyval.c | 9 +- util/log.c | 4 +- util/main-loop.c | 2 +- util/qemu-config.c | 28 ++-- util/qemu-option.c | 68 +++++---- util/qemu-sockets.c | 79 ++++++----- util/throttle.c | 2 +- vl.c | 99 +++++++------ tests/Makefile.include | 2 +- 859 files changed, 5107 insertions(+), 4988 deletions(-)
Signature · 1 line
2.11.0.259.g40922b1
RFC 3/15 Add qapi/error.h includes on files that will need it
Some files will be changed by scripts to use macros defined in qapi/error.h. This patch adds the #include lines manually because it would be harder to do it in the Coccinelle scripts.
--- scripts/qapi-types.py | 1 + include/hw/audio/pcspk.h | 1 + include/hw/isa/isa.h | 1 + include/migration/vmstate.h | 1 + target/s390x/cpu.h | 1 + block/block-backend.c | 1 + block/iscsi.c | 1 + bsd-user/elfload.c | 1 + chardev/char-io.c | 1 + hw/9pfs/xen-9p-backend.c | 1 + hw/acpi/memory_hotplug.c | 1 + hw/acpi/nvdimm.c | 1 + hw/acpi/vmgenid.c | 1 + hw/core/platform-bus.c | 1 + hw/core/sysbus.c | 1 + hw/display/vga-pci.c | 1 + hw/i386/pc.c | 1 + hw/i386/pc_q35.c | 1 + hw/ide/ich.c | 1 + hw/input/virtio-input-hid.c | 1 + hw/intc/s390_flic_kvm.c | 1 + hw/ipmi/ipmi.c | 1 + hw/isa/lpc_ich9.c | 1 + hw/mips/mips_malta.c | 1 + hw/misc/auxbus.c | 1 + hw/misc/edu.c | 1 + hw/misc/pvpanic.c | 1 + hw/net/e1000.c | 1 + hw/net/e1000e.c | 1 + hw/net/eepro100.c | 1 + hw/net/lance.c | 1 + hw/net/ne2000.c | 1 + hw/net/pcnet-pci.c | 1 + hw/net/rtl8139.c | 1 + hw/net/spapr_llan.c | 1 + hw/net/virtio-net.c | 1 + hw/net/vmxnet3.c | 1 + hw/pci-host/gpex.c | 1 + hw/pci-host/xilinx-pcie.c | 1 + hw/pci/pci.c | 1 + hw/pcmcia/pxa2xx.c | 1 + hw/ppc/prep.c | 1 + hw/ppc/spapr_iommu.c | 1 + hw/ppc/spapr_rtc.c | 1 + hw/s390x/s390-skeys.c | 1 + hw/timer/mc146818rtc.c | 1 + hw/usb/hcd-ehci-pci.c | 1 + hw/virtio/virtio-balloon.c | 1 + hw/watchdog/watchdog.c | 1 + hw/xen/xen_pvdev.c | 1 + linux-user/elfload.c | 1 + linux-user/uname.c | 1 + migration/qemu-file-channel.c | 1 + migration/ram.c | 1 + numa.c | 1 + qom/container.c | 1 + target/m68k/helper.c | 1 + target/microblaze/translate.c | 1 + target/mips/translate.c | 1 + target/ppc/kvm.c | 1 + target/s390x/kvm.c | 1 + target/xtensa/helper.c | 1 + tests/test-crypto-hash.c | 1 + tests/test-io-channel-tls.c | 1 + tests/test-qdev-global-props.c | 1 + ui/gtk.c | 1 + ui/spice-core.c | 1 + util/qemu-config.c | 1 + 68 files changed, 68 insertions(+)
scripts/qapi-types.py +1 -0
@@ -287,6 +287,7 @@ h_comment = ''' fdef.write(mcgen(''' #include "qemu/osdep.h" #include "qapi/dealloc-visitor.h" +#include "qapi/error.h" #include "%(prefix)sqapi-types.h" #include "%(prefix)sqapi-visit.h" ''',
include/hw/audio/pcspk.h +1 -0
@@ -25,6 +25,7 @@#ifndef HW_PCSPK_H #define HW_PCSPK_H +#include "qapi/error.h" #include "hw/hw.h" #include "hw/isa/isa.h"
include/hw/isa/isa.h +1 -0
@@ -3,6 +3,7 @@/* ISA bus */ +#include "qapi/error.h" #include "exec/memory.h" #include "exec/ioport.h" #include "hw/qdev.h"
include/migration/vmstate.h +1 -0
@@ -27,6 +27,7 @@#ifndef QEMU_VMSTATE_H #define QEMU_VMSTATE_H +#include "qapi/error.h" #include "migration/qjson.h" typedef void SaveStateHandler (QEMUFile *f,void *opaque);
target/s390x/cpu.h +1 -0
@@ -24,6 +24,7 @@#define S390X_CPU_H #include "qemu-common.h" +#include "qapi/error.h" #include "cpu-qom.h" #define TARGET_LONG_BITS 64
block/block-backend.c +1 -0
@@ -11,6 +11,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "sysemu/block-backend.h" #include "block/block_int.h" #include "block/blockjob.h"
block/iscsi.c +1 -0
@@ -24,6 +24,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include <poll.h> #include <math.h>
bsd-user/elfload.c +1 -0
@@ -1,6 +1,7 @@/* This is the Linux kernel elf-loading code, ported into user space */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "qemu.h" #include "disas/disas.h"
chardev/char-io.c +1 -0
@@ -22,6 +22,7 @@* THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "chardev/char-io.h" typedef struct IOWatchPoll {
hw/9pfs/xen-9p-backend.c +1 -0
@@ -9,6 +9,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/hw.h" #include "hw/9pfs/9p.h"
hw/acpi/memory_hotplug.c +1 -0
@@ -1,4 +1,5 @@#include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/acpi/memory_hotplug.h" #include "hw/acpi/pc-hotplug.h" #include "hw/mem/pc-dimm.h"
hw/acpi/nvdimm.c +1 -0
@@ -27,6 +27,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/acpi/acpi.h" #include "hw/acpi/aml-build.h" #include "hw/acpi/bios-linker-loader.h"
hw/acpi/vmgenid.c +1 -0
@@ -11,6 +11,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "qmp-commands.h" #include "hw/acpi/acpi.h" #include "hw/acpi/aml-build.h"
hw/core/platform-bus.c +1 -0
@@ -20,6 +20,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/platform-bus.h" #include "exec/address-spaces.h" #include "qemu/error-report.h"
hw/core/sysbus.c +1 -0
@@ -18,6 +18,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/sysbus.h" #include "monitor/monitor.h" #include "exec/address-spaces.h"
hw/display/vga-pci.c +1 -0
@@ -24,6 +24,7 @@* THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/hw.h" #include "ui/console.h" #include "hw/pci/pci.h"
hw/i386/pc.c +1 -0
@@ -22,6 +22,7 @@* THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/hw.h" #include "hw/i386/pc.h" #include "hw/char/serial.h"
hw/i386/pc_q35.c +1 -0
@@ -28,6 +28,7 @@* THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/hw.h" #include "hw/loader.h" #include "sysemu/arch_init.h"
hw/ide/ich.c +1 -0
@@ -61,6 +61,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/hw.h" #include "hw/pci/msi.h" #include "hw/i386/pc.h"
hw/input/virtio-input-hid.c +1 -0
@@ -5,6 +5,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "qemu/iov.h" #include "hw/qdev.h"
hw/intc/s390_flic_kvm.c +1 -0
@@ -11,6 +11,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" #include <sys/ioctl.h>
hw/ipmi/ipmi.c +1 -0
@@ -23,6 +23,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/hw.h" #include "hw/ipmi/ipmi.h" #include "sysemu/sysemu.h"
hw/isa/lpc_ich9.c +1 -0
@@ -28,6 +28,7 @@* THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" #include "hw/hw.h"
hw/mips/mips_malta.c +1 -0
@@ -23,6 +23,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" #include "hw/hw.h"
hw/misc/auxbus.c +1 -0
@@ -27,6 +27,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "qemu/log.h" #include "hw/misc/auxbus.h" #include "hw/i2c/i2c.h"
hw/misc/edu.c +1 -0
@@ -23,6 +23,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/pci/pci.h" #include "hw/pci/msi.h" #include "qemu/timer.h"
hw/misc/pvpanic.c +1 -0
@@ -13,6 +13,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "qapi/qmp/qobject.h" #include "qapi/qmp/qjson.h" #include "sysemu/sysemu.h"
hw/net/e1000.c +1 -0
@@ -26,6 +26,7 @@#include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/hw.h" #include "hw/pci/pci.h" #include "net/net.h"
hw/net/e1000e.c +1 -0
@@ -34,6 +34,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "net/net.h" #include "net/tap.h" #include "qemu/range.h"
hw/net/eepro100.c +1 -0
@@ -41,6 +41,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/hw.h" #include "hw/pci/pci.h" #include "net/net.h"
hw/net/lance.c +1 -0
@@ -36,6 +36,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/sysbus.h" #include "net/net.h" #include "qemu/timer.h"
hw/net/ne2000.c +1 -0
@@ -22,6 +22,7 @@* THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/hw.h" #include "hw/pci/pci.h" #include "net/net.h"
hw/net/pcnet-pci.c +1 -0
@@ -28,6 +28,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/pci/pci.h" #include "net/net.h" #include "hw/loader.h"
hw/net/rtl8139.c +1 -0
@@ -50,6 +50,7 @@/* For crc32 */ #include "qemu/osdep.h" +#include "qapi/error.h" #include <zlib.h> #include "hw/hw.h"
hw/net/spapr_llan.c +1 -0
@@ -25,6 +25,7 @@* */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" #include "hw/hw.h"
hw/net/virtio-net.c +1 -0
@@ -12,6 +12,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "qemu/iov.h" #include "hw/virtio/virtio.h" #include "net/net.h"
hw/net/vmxnet3.c +1 -0
@@ -16,6 +16,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/hw.h" #include "hw/pci/pci.h" #include "net/net.h"
hw/pci-host/gpex.c +1 -0
@@ -29,6 +29,7 @@* http://www.firmware.org/1275/practice/imap/imap0_9d.pdf */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/hw.h" #include "hw/pci-host/gpex.h"
hw/pci-host/xilinx-pcie.c +1 -0
@@ -18,6 +18,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/pci/pci_bridge.h" #include "hw/pci-host/xilinx-pcie.h"
hw/pci/pci.c +1 -0
@@ -22,6 +22,7 @@* THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/hw.h" #include "hw/pci/pci.h" #include "hw/pci/pci_bridge.h"
hw/pcmcia/pxa2xx.c +1 -0
@@ -11,6 +11,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/hw.h" #include "hw/sysbus.h" #include "hw/pcmcia.h"
hw/ppc/prep.c +1 -0
@@ -23,6 +23,7 @@* THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "cpu.h" #include "hw/hw.h" #include "hw/timer/m48t59.h"
hw/ppc/spapr_iommu.c +1 -0
@@ -17,6 +17,7 @@* License along with this library; if not, see <http://www.gnu.org/licenses/>. */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "qemu/error-report.h" #include "hw/hw.h" #include "qemu/log.h"
hw/ppc/spapr_rtc.c +1 -0
@@ -26,6 +26,7 @@* */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "cpu.h" #include "qemu/timer.h" #include "sysemu/sysemu.h"
hw/s390x/s390-skeys.c +1 -0
@@ -10,6 +10,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/boards.h" #include "qmp-commands.h" #include "hw/s390x/storage-keys.h"
hw/timer/mc146818rtc.c +1 -0
@@ -22,6 +22,7 @@* THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "qemu/cutils.h" #include "qemu/bcd.h" #include "hw/hw.h"
hw/usb/hcd-ehci-pci.c +1 -0
@@ -16,6 +16,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/usb/hcd-ehci.h" #include "qemu/range.h"
hw/virtio/virtio-balloon.c +1 -0
@@ -14,6 +14,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "qemu/iov.h" #include "qemu/timer.h" #include "qemu-common.h"
hw/watchdog/watchdog.c +1 -0
@@ -20,6 +20,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "qemu/option.h" #include "qemu/config-file.h" #include "qemu/queue.h"
hw/xen/xen_pvdev.c +1 -0
@@ -18,6 +18,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "qemu/log.h" #include "hw/qdev-core.h" #include "hw/xen/xen_backend.h"
linux-user/elfload.c +1 -0
@@ -1,5 +1,6 @@/* This is the Linux kernel elf-loading code, ported into user space */ #include "qemu/osdep.h" +#include "qapi/error.h" #include <sys/param.h> #include <sys/resource.h>
linux-user/uname.c +1 -0
@@ -18,6 +18,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "qemu.h" //#include "qemu-common.h"
migration/qemu-file-channel.c +1 -0
@@ -23,6 +23,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "qemu-file-channel.h" #include "exec/cpu-common.h" #include "qemu-file.h"
migration/ram.c +1 -0
@@ -26,6 +26,7 @@* THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" #include <zlib.h>
numa.c +1 -0
@@ -23,6 +23,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "sysemu/numa.h" #include "exec/cpu-common.h" #include "exec/ramlist.h"
qom/container.c +1 -0
@@ -11,6 +11,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "qom/object.h" #include "qemu/module.h"
target/m68k/helper.c +1 -0
@@ -19,6 +19,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "cpu.h" #include "exec/exec-all.h" #include "exec/gdbstub.h"
target/microblaze/translate.c +1 -0
@@ -19,6 +19,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "cpu.h" #include "disas/disas.h" #include "exec/exec-all.h"
target/mips/translate.c +1 -0
@@ -22,6 +22,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "cpu.h" #include "disas/disas.h" #include "exec/exec-all.h"
target/ppc/kvm.c +1 -0
@@ -15,6 +15,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include <dirent.h> #include <sys/ioctl.h> #include <sys/vfs.h>
target/s390x/kvm.c +1 -0
@@ -22,6 +22,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include <sys/ioctl.h> #include <linux/kvm.h>
target/xtensa/helper.c +1 -0
@@ -26,6 +26,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "cpu.h" #include "exec/exec-all.h" #include "exec/gdbstub.h"
tests/test-crypto-hash.c +1 -0
@@ -19,6 +19,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "crypto/init.h" #include "crypto/hash.h"
tests/test-io-channel-tls.c +1 -0
@@ -22,6 +22,7 @@#include "qemu/osdep.h" +#include "qapi/error.h" #include "crypto-tls-x509-helpers.h" #include "io/channel-tls.h"
tests/test-qdev-global-props.c +1 -0
@@ -23,6 +23,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/qdev.h" #include "qom/object.h"
ui/gtk.c +1 -0
@@ -35,6 +35,7 @@#define LOCALEDIR "po"#include "qemu/osdep.h" +#include "qapi/error.h" #include "qemu-common.h" #include "qemu/cutils.h"
ui/spice-core.c +1 -0
@@ -16,6 +16,7 @@*/ #include "qemu/osdep.h" +#include "qapi/error.h" #include <spice.h> #include <netdb.h>
util/qemu-config.c +1 -0
@@ -1,4 +1,5 @@#include "qemu/osdep.h" +#include "qapi/error.h" #include "qemu-common.h" #include "qemu/error-report.h" #include "qemu/option.h"
Signature · 1 line
2.11.0.259.g40922b1
RFC 5/15 qapi: Use IGNORE_ERRORS instead of NULL on generated code
In reply to Eduardo Habkost--- scripts/qapi-commands.py | 6 +++--- scripts/qapi-types.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
scripts/qapi-commands.py +3 -3
@@ -75,7 +75,7 @@ static void qmp_marshal_output_%(c_name)s(%(c_type)s ret_in, QObject **ret_out, error_propagate(errp, err); visit_free(v); v = qapi_dealloc_visitor_new(); - visit_type_%(c_name)s(v, "unused", &ret_in, NULL); + visit_type_%(c_name)s(v, "unused", &ret_in, IGNORE_ERRORS); visit_free(v); } ''',
@@ -162,7 +162,7 @@ out: ''') if have_args: - visit_members = ('visit_type_%s_members(v, &arg, NULL);' + visit_members = ('visit_type_%s_members(v, &arg, IGNORE_ERRORS);' % arg_type.c_name()) else: visit_members = ''
@@ -173,7 +173,7 @@ out: ret += mcgen(''' v = qapi_dealloc_visitor_new(); - visit_start_struct(v, NULL, NULL, 0, NULL); + visit_start_struct(v, NULL, NULL, 0, IGNORE_ERRORS); %(visit_members)s visit_end_struct(v, NULL); visit_free(v);
scripts/qapi-types.py +1 -1
@@ -157,7 +157,7 @@ void qapi_free_%(c_name)s(%(c_name)s *obj) } v = qapi_dealloc_visitor_new(); - visit_type_%(c_name)s(v, NULL, &obj, NULL); + visit_type_%(c_name)s(v, NULL, &obj, IGNORE_ERRORS); visit_free(v); } ''',
Signature · 1 line
2.11.0.259.g40922b1
RFC 6/15 test-qapi-util: Use IGNORE_ERRORS instead of NULL
In reply to Eduardo Habkost--- tests/test-qapi-util.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
tests/test-qapi-util.c +7 -7
@@ -25,7 +25,7 @@ static void test_qapi_enum_parse(void) g_assert_cmpint(ret, ==, QTYPE_NONE); ret =qapi_enum_parse (QType_lookup,"junk" ,QTYPE__MAX ,-1 , -NULL ); +IGNORE_ERRORS ); g_assert_cmpint(ret, ==, -1); ret = qapi_enum_parse(QType_lookup, "junk", QTYPE__MAX, -1,
@@ -137,14 +137,14 @@ static void test_error_api(void) {Error *err =NULL ; -successfn (NULL ); -test_propagate (successfn,NULL ); +successfn (IGNORE_ERRORS ); +test_propagate (successfn,IGNORE_ERRORS ); -fail1 (NULL ); -test_propagate (fail1,NULL ); +fail1 (IGNORE_ERRORS ); +test_propagate (fail1,IGNORE_ERRORS ); -multifn (NULL ); -test_propagate (multifn,NULL ); +multifn (IGNORE_ERRORS ); +test_propagate (multifn,IGNORE_ERRORS );successfn (&err);g_assert (!err);
Signature · 1 line
2.11.0.259.g40922b1
RFC 8/15 error: New ERR_IS_* macros for checking Error** values
In reply to Eduardo HabkostDefine new macros that should be used when checking errp values. Existing methods will still work by now, but will break once we implement IGNORE_ERRORS in a different way later. Other patches will convert existing code to use the new macros.
TODO: write more detailed API documentation
--- include/qapi/error.h | 3 +++ 1 file changed, 3 insertions(+)
include/qapi/error.h +3 -0
@@ -119,6 +119,9 @@#define IGNORE_ERRORS (NULL) +#define ERR_IS_SET (e) (!!*(e)) +#define ERR_IS_IGNORED (e) (!(e)) +/* * Overall category of an error. * Based on the qapi type QapiErrorClass, but reproduced here for nicer
Signature · 1 line
2.11.0.259.g40922b1
RFC 7/15 Manual changes to use IGNORE_ERRORS instead of NULL
In reply to Eduardo HabkostThese cases were missed by the Coccinelle script for some, reason, so I fixed them manually.
--- block/crypto.c | 4 ++-- block/qcow2.c | 2 +- block/snapshot.c | 2 +- hw/acpi/cpu.c | 2 +- hw/core/qdev.c | 8 ++++---- hw/isa/lpc_ich9.c | 2 +- hw/ppc/spapr_drc.c | 6 +++--- hw/s390x/css.c | 2 +- hw/vfio/ccw.c | 2 +- hw/watchdog/watchdog.c | 2 +- hw/xen/xen_backend.c | 4 ++-- migration/colo.c | 4 ++-- migration/rdma.c | 2 +- monitor.c | 4 ++-- nbd/server.c | 2 +- net/net.c | 2 +- qapi/opts-visitor.c | 2 +- vl.c | 50 +++++++++++++++++++++++++------------------------- 18 files changed, 51 insertions(+), 51 deletions(-)
block/crypto.c +2 -2
@@ -449,7 +449,7 @@ block_crypto_co_readv(BlockDriverState *bs, int64_t sector_num,if (qcrypto_block_decrypt (crypto->block, sector_num, cipher_data, cur_nr_sectors *512 , -NULL ) <0 ) { +IGNORE_ERRORS ) <0 ) { ret = -EIO ; goto cleanup; }
@@ -510,7 +510,7 @@ block_crypto_co_writev(BlockDriverState *bs, int64_t sector_num,if (qcrypto_block_encrypt (crypto->block, sector_num, cipher_data, cur_nr_sectors *512 , -NULL ) <0 ) { +IGNORE_ERRORS ) <0 ) { ret = -EIO ; goto cleanup; }
block/qcow2.c +1 -1
@@ -2602,7 +2602,7 @@ qcow2_co_pwritev_compressed(BlockDriverState *bs, uint64_t offset,/* align end of file to a sector boundary to ease reading with sector based I/Os */ cluster_offset =bdrv_getlength (bs->file->bs); -return bdrv_truncate (bs->file, cluster_offset,NULL ); +return bdrv_truncate (bs->file, cluster_offset,IGNORE_ERRORS ); } buf =qemu_blockalign (bs, s->cluster_size);
block/snapshot.c +1 -1
@@ -207,7 +207,7 @@ int bdrv_snapshot_goto(BlockDriverState *bs, bs->file =NULL ; ret =bdrv_snapshot_goto (file, snapshot_id); - open_ret = drv->bdrv_open (bs, options, bs->open_flags,NULL ); + open_ret = drv->bdrv_open (bs, options, bs->open_flags,IGNORE_ERRORS );QDECREF (options);if (open_ret <0 ) {bdrv_unref (file);
hw/acpi/cpu.c +1 -1
@@ -125,7 +125,7 @@ static void cpu_hotplug_wr(void *opaque, hwaddr addr, uint64_t data,trace_cpuhp_acpi_ejecting_cpu (cpu_st->selector); dev =DEVICE (cdev->cpu); hotplug_ctrl =qdev_get_hotplug_handler (dev); -hotplug_handler_unplug (hotplug_ctrl, dev,NULL ); +hotplug_handler_unplug (hotplug_ctrl, dev,IGNORE_ERRORS ); }break ;case ACPI_CPU_CMD_OFFSET_WR :
hw/core/qdev.c +4 -4
@@ -952,9 +952,9 @@ static void device_set_realized(Object *obj, bool value, Error **errp) } dev->pending_deleted_event = false; }else if (!value && dev->realized) { -Error **local_errp =NULL ; +Error **local_errp =IGNORE_ERRORS ; QLIST_FOREACH(bus, &dev->child_bus, sibling) { - local_errp = local_err ?NULL : &local_err; + local_errp = local_err ?IGNORE_ERRORS : &local_err;object_property_set_bool (OBJECT (bus), false,"realized" , local_errp); }
@@ -962,7 +962,7 @@ static void device_set_realized(Object *obj, bool value, Error **errp)vmstate_unregister (dev,qdev_get_vmsd (dev), dev); }if (dc->unrealize) { - local_errp = local_err ?NULL : &local_err; + local_errp = local_err ?IGNORE_ERRORS : &local_err; dc->unrealize (dev, local_errp); } dev->pending_deleted_event = true;
@@ -988,7 +988,7 @@ child_realize_fail: post_realize_fail:if (dc->unrealize) { - dc->unrealize (dev,NULL ); + dc->unrealize (dev,IGNORE_ERRORS ); } fail:
hw/isa/lpc_ich9.c +1 -1
@@ -659,7 +659,7 @@ static void ich9_lpc_add_properties(ICH9LPCState *lpc)object_property_add_uint8_ptr (OBJECT (lpc),ACPI_PM_PROP_ACPI_DISABLE_CMD , &acpi_disable_cmd,IGNORE_ERRORS ); -ich9_pm_add_properties (OBJECT (lpc), &lpc->pm,NULL ); +ich9_pm_add_properties (OBJECT (lpc), &lpc->pm,IGNORE_ERRORS ); }static void ich9_lpc_initfn (Object *obj)
hw/ppc/spapr_drc.c +3 -3
@@ -105,7 +105,7 @@ static uint32_t set_isolation_state(sPAPRDRConnector *drc,uint32_t drc_index =spapr_drc_index (drc);if (drc->configured) {trace_spapr_drc_set_isolation_state_finalizing (drc_index); - drck->detach (drc,DEVICE (drc->dev),NULL ); + drck->detach (drc,DEVICE (drc->dev),IGNORE_ERRORS ); }else {trace_spapr_drc_set_isolation_state_deferring (drc_index); }
@@ -159,7 +159,7 @@ static uint32_t set_allocation_state(sPAPRDRConnector *drc, drc->allocation_state == SPAPR_DR_ALLOCATION_STATE_UNUSABLE) {uint32_t drc_index =spapr_drc_index (drc);trace_spapr_drc_set_allocation_state_finalizing (drc_index); - drck->detach (drc,DEVICE (drc->dev),NULL ); + drck->detach (drc,DEVICE (drc->dev),IGNORE_ERRORS ); } else if (drc->allocation_state == SPAPR_DR_ALLOCATION_STATE_USABLE) { drc->awaiting_allocation = false; }
@@ -467,7 +467,7 @@ static void reset(DeviceState *d)* force removal if we are */ if (drc->awaiting_release) { - drck->detach (drc,DEVICE (drc->dev),NULL ); + drck->detach (drc,DEVICE (drc->dev),IGNORE_ERRORS ); }/* non-PCI devices may be awaiting a transition to UNUSABLE */
hw/s390x/css.c +1 -1
@@ -2070,7 +2070,7 @@ SubchDev *css_create_sch(CssDevId bus_id, bool is_virtual, bool squash_mcss,if (css_find_free_subch_and_devno (bus_id.cssid, &bus_id.ssid, &bus_id.devid, &schid, -NULL )) { +IGNORE_ERRORS )) {break ; }if (bus_id.cssid ==MAX_CSSID ) {
hw/vfio/ccw.c +1 -1
@@ -370,7 +370,7 @@ out_device_err:vfio_put_group (group); out_group_err:if (cdc->unrealize) { - cdc->unrealize (cdev,NULL ); + cdc->unrealize (cdev,IGNORE_ERRORS ); } out_err_propagate:error_propagate (errp, err);
hw/watchdog/watchdog.c +1 -1
@@ -144,7 +144,7 @@ void watchdog_perform_action(void)case WDT_NMI :qapi_event_send_watchdog (WATCHDOG_EXPIRATION_ACTION_INJECT_NMI , &error_abort); -nmi_monitor_handle (0 ,NULL ); +nmi_monitor_handle (0 ,IGNORE_ERRORS );break ; } }
hw/xen/xen_backend.c +2 -2
@@ -143,7 +143,7 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev, xendev->evtchndev =xenevtchn_open (NULL ,0 );if (xendev->evtchndev ==NULL ) {xen_pv_printf (NULL ,0 ,"can't open evtchn device\n" ); -qdev_unplug (DEVICE (xendev),NULL ); +qdev_unplug (DEVICE (xendev),IGNORE_ERRORS );return NULL ; }qemu_set_cloexec (xenevtchn_fd (xendev->evtchndev));
@@ -153,7 +153,7 @@ static struct XenDevice *xen_be_get_xendev(const char *type, int dom, int dev,if (xendev->gnttabdev ==NULL ) {xen_pv_printf (NULL ,0 ,"can't open gnttab device\n" );xenevtchn_close (xendev->evtchndev); -qdev_unplug (DEVICE (xendev),NULL ); +qdev_unplug (DEVICE (xendev),IGNORE_ERRORS );return NULL ; } }else {
migration/colo.c +2 -2
@@ -175,7 +175,7 @@ void qmp_xen_set_replication(bool enable, bool primary,if (!has_failover) { failover =NULL ; } - replication_stop_all(failover, failover ? NULL : errp); + replication_stop_all(failover, failover ? IGNORE_ERRORS : errp); }#else abort ();
@@ -641,7 +641,7 @@ void *colo_process_incoming_thread(void *opaque)if (failover_get_state () ==FAILOVER_STATUS_RELAUNCH ) {failover_set_state (FAILOVER_STATUS_RELAUNCH ,FAILOVER_STATUS_NONE ); -failover_request_active (NULL ); +failover_request_active (IGNORE_ERRORS ); goto out; }
migration/rdma.c +1 -1
@@ -2509,7 +2509,7 @@ static void *qemu_rdma_data_init(const char *host_port, Error **errp) rdma->current_chunk =-1 ; addr =g_new (InetSocketAddress,1 ); -if (!inet_parse (addr, host_port,NULL )) { +if (!inet_parse (addr, host_port,IGNORE_ERRORS )) { rdma->port =atoi (addr->port); rdma->host =g_strdup (addr->host); }else {
monitor.c +2 -2
@@ -3467,7 +3467,7 @@ void netdev_del_completion(ReadLineState *rs, int nb_args, const char *str)if (strncmp (str, name, len)) {continue ; } - opts =qemu_opts_find (qemu_find_opts_err ("netdev" ,NULL ), name); + opts =qemu_opts_find (qemu_find_opts_err ("netdev" ,IGNORE_ERRORS ), name);if (opts) {readline_add_completion (rs, name); }
@@ -3642,7 +3642,7 @@ static void vm_completion(ReadLineState *rs, const char *str)aio_context_acquire (ctx);if (bdrv_can_snapshot (bs)) { - ok =bdrv_query_snapshot_info_list (bs, &snapshots,NULL ) ==0 ; + ok =bdrv_query_snapshot_info_list (bs, &snapshots,IGNORE_ERRORS ) ==0 ; }aio_context_release (ctx);if (!ok) {
nbd/server.c +1 -1
@@ -388,7 +388,7 @@ static QIOChannel *nbd_negotiate_handle_starttls(NBDClient *client, tioc =qio_channel_tls_new_server (ioc, client->tlscreds, client->tlsaclname, -NULL ); +IGNORE_ERRORS );if (!tioc) {return NULL ; }
net/net.c +1 -1
@@ -1248,7 +1248,7 @@ void qmp_netdev_del(const char *id, Error **errp)return ; } - opts =qemu_opts_find (qemu_find_opts_err ("netdev" ,NULL ), id); + opts =qemu_opts_find (qemu_find_opts_err ("netdev" ,IGNORE_ERRORS ), id);if (!opts) {error_setg (errp,"Device '%s' is not a netdev" , id);return ;
qapi/opts-visitor.c +1 -1
@@ -516,7 +516,7 @@ opts_optional(Visitor *v, const char *name, bool *present)/* we only support a single mandatory scalar field in a list node */ assert (ov->list_mode ==LM_NONE ); - *present = (lookup_distinct (ov, name,NULL ) !=NULL ); + *present = (lookup_distinct (ov, name,IGNORE_ERRORS ) !=NULL ); }
vl.c +25 -25
179 lines not on this page · raw message
Signature · 1 line
2.11.0.259.g40922b1
RFC 10/15 test-qapi-util: Use ERR_IS_* macros
In reply to Eduardo Habkost--- tests/test-qapi-util.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
tests/test-qapi-util.c +7 -7
@@ -77,25 +77,25 @@ static void test_parse_qapi_name(void)static void successfn (Error **errp) { -g_assert (!errp || !*errp); +g_assert (ERR_IS_IGNORED (errp) || !ERR_IS_SET (errp)); }static void fail1 (Error **errp) { -g_assert (!errp || !*errp); +g_assert (ERR_IS_IGNORED (errp) || !ERR_IS_SET (errp));error_setg (errp,"error1" ); -g_assert (!errp || *errp); +g_assert (ERR_IS_IGNORED (errp) ||ERR_IS_SET (errp)); }static void fail2 (Error **errp) { -g_assert (!errp || !*errp); +g_assert (ERR_IS_IGNORED (errp) || !ERR_IS_SET (errp));error_setg (errp,"error2" ); -g_assert (!errp || *errp); +g_assert (ERR_IS_IGNORED (errp) ||ERR_IS_SET (errp)); }static void multifn (Error **errp)
@@ -124,13 +124,13 @@ static void test_propagate(void (*fn)(Error **), Error **errp)bool failed;Error *local_err =NULL ; -g_assert (!errp || !*errp); +g_assert (ERR_IS_IGNORED (errp) || !ERR_IS_SET (errp));fn (&local_err); failed = !!local_err;error_propagate (errp, local_err); -g_assert (!errp || (failed == !!*errp)); +g_assert (ERR_IS_IGNORED (errp) || (failed == !!ERR_IS_SET (errp))); }static void test_error_api (void )
Signature · 1 line
2.11.0.259.g40922b1
RFC 9/15 Use ERR_IS_* macros
In reply to Eduardo HabkostGenerated by the following Coccinelle patch:
@@
typedef Error;
idexpression Error ** errp;
statement ST;
@@
-if (*errp)
+if (ERR_IS_SET(errp))
ST
@@
typedef Error;
idexpression Error ** errp;
statement ST;
@@
-if (!*errp)
+if (!ERR_IS_SET(errp))
ST
@@
typedef Error;
idexpression Error ** errp;
@@
-assert(!*errp)
+assert(!ERR_IS_SET(errp))
@@
typedef Error;
idexpression Error ** errp;
@@
- assert(errp && *errp);
+ assert(!ERR_IS_IGNORED(errp) && ERR_IS_SET(errp));
@@
typedef Error;
idexpression Error ** errp;
@@
- assert(errp && !*errp);
+ assert(!ERR_IS_IGNORED(errp) && !ERR_IS_SET(errp));
@@
typedef Error;
idexpression Error ** errp;
@@
- assert(!errp || !*errp);
+ assert(!ERR_IS_IGNORED(errp) || !ERR_IS_SET(errp));
@@
typedef Error;
idexpression Error ** errp;
statement ST;
@@
-if (errp)
+if (!ERR_IS_IGNORED(errp))
ST
@@
typedef Error;
idexpression Error ** errp;
statement ST;
@@
-if (!errp)
+if (ERR_IS_IGNORED(errp))
ST
@@
typedef Error;
idexpression Error ** errp;
statement ST;
@@
-if (errp && *errp)
+if (!ERR_IS_IGNORED(errp) && ERR_IS_SET(errp))
ST
@@
typedef Error;
idexpression Error ** errp;
statement ST;
@@
-if (errp && *errp != NULL)
+if (!ERR_IS_IGNORED(errp) && ERR_IS_SET(errp))
ST
@@
typedef Error;
idexpression Error ** errp;
statement ST;
@@
-if (errp && !*errp)
+if (!ERR_IS_IGNORED(errp) && !ERR_IS_SET(errp))
ST
@@
typedef Error;
idexpression Error ** errp;
statement ST;
@@
-if (errp && *errp == NULL)
+if (!ERR_IS_IGNORED(errp) && !ERR_IS_SET(errp))
ST--- block.c | 2 +- hw/acpi/cpu_hotplug.c | 2 +- hw/ipmi/isa_ipmi_bt.c | 2 +- hw/mem/pc-dimm.c | 2 +- hw/ppc/spapr.c | 2 +- hw/ppc/spapr_pci.c | 2 +- hw/s390x/event-facility.c | 2 +- net/net.c | 2 +- qapi/qobject-input-visitor.c | 2 +- qga/commands-posix.c | 2 +- target/s390x/cpu_models.c | 30 +++++++++++++++--------------- target/s390x/helper.c | 2 +- tests/test-crypto-tlscredsx509.c | 2 +- tests/test-io-channel-tls.c | 2 +- util/error.c | 12 ++++++------ 15 files changed, 34 insertions(+), 34 deletions(-)
block.c +1 -1
@@ -1383,7 +1383,7 @@ static QDict *parse_json_filename(const char *filename, Error **errp) options_obj =qobject_from_json (filename, errp);if (!options_obj) {/* Work around qobject_from_json() lossage TODO fix that */ -if (errp && !*errp) { +if (!ERR_IS_IGNORED (errp) && !ERR_IS_SET (errp)) {error_setg (errp,"Could not parse the JSON options" );return NULL ; }
hw/acpi/cpu_hotplug.c +1 -1
@@ -76,7 +76,7 @@ void legacy_acpi_cpu_plug_cb(HotplugHandler *hotplug_dev, AcpiCpuHotplug *g, DeviceState *dev, Error **errp) {acpi_set_cpu_present_bit (g,CPU (dev), errp); -if (*errp !=NULL ) { +if (ERR_IS_SET (errp)) {return ; }acpi_send_event (DEVICE (hotplug_dev),ACPI_CPU_HOTPLUG_STATUS );
hw/ipmi/isa_ipmi_bt.c +1 -1
@@ -438,7 +438,7 @@ static void isa_ipmi_bt_realize(DeviceState *dev, Error **errp) iib->bt.bmc->intf = ii; iic->init (ii, errp); -if (*errp) +if (ERR_IS_SET (errp))return ;if (iib->isairq >0 ) {
hw/mem/pc-dimm.c +1 -1
@@ -316,7 +316,7 @@ uint64_t pc_dimm_get_free_addr(uint64_t address_space_start,uint64_t dimm_size =object_property_get_int (OBJECT (dimm),PC_DIMM_SIZE_PROP , errp); -if (errp && *errp) { +if (!ERR_IS_IGNORED (errp) &&ERR_IS_SET (errp)) { goto out; }
hw/ppc/spapr.c +1 -1
@@ -2983,7 +2983,7 @@ static void spapr_machine_device_plug(HotplugHandler *hotplug_dev,return ; } node =object_property_get_int (OBJECT (dev),PC_DIMM_NODE_PROP , errp); -if (*errp) { +if (ERR_IS_SET (errp)) {return ; }if (node <0 || node >=MAX_NODES ) {
hw/ppc/spapr_pci.c +1 -1
@@ -1364,7 +1364,7 @@ static void spapr_phb_add_pci_device(sPAPRDRConnector *drc, drck->attach (drc,DEVICE (pdev), fdt, fdt_start_offset, !dev->hotplugged, errp); out: -if (*errp) { +if (ERR_IS_SET (errp)) {g_free (fdt); } }
hw/s390x/event-facility.c +1 -1
@@ -296,7 +296,7 @@ static void sclp_events_bus_realize(BusState *bus, Error **errp)DeviceState *dev = kid->child;object_property_set_bool (OBJECT (dev), true,"realized" , errp); -if (*errp) { +if (ERR_IS_SET (errp)) {return ; } }
net/net.c +1 -1
@@ -1061,7 +1061,7 @@ static int net_client_init1(const void *object, bool is_netdev, Error **errp)if (net_client_init_fun[netdev->type](netdev, name, peer, errp) <0 ) {/* FIXME drop when all init functions store an Error */ -if (errp && !*errp) { +if (!ERR_IS_IGNORED (errp) && !ERR_IS_SET (errp)) {error_setg (errp,QERR_DEVICE_INIT_FAILED , NetClientDriver_lookup[netdev->type]); }
qapi/qobject-input-visitor.c +1 -1
@@ -723,7 +723,7 @@ Visitor *qobject_input_visitor_new_str(const char *str, obj =qobject_from_json (str, errp);if (!obj) {/* Work around qobject_from_json() lossage TODO fix that */ -if (errp && !*errp) { +if (!ERR_IS_IGNORED (errp) && !ERR_IS_SET (errp)) {error_setg (errp,"JSON parse error" );return NULL ; }
qga/commands-posix.c +1 -1
@@ -1025,7 +1025,7 @@ static void build_guest_fsinfo_for_virtual_device(char const *syspath,build_guest_fsinfo_for_device (path, fs, errp);g_free (path); -if (*errp) { +if (ERR_IS_SET (errp)) {break ; } }
target/s390x/cpu_models.c +15 -15
@@ -348,22 +348,22 @@ static void cpu_model_from_info(S390CPUModel *model, const CpuModelInfo *info,if (qdict) { visitor =qobject_input_visitor_new (info->props);visit_start_struct (visitor,NULL ,NULL ,0 , errp); -if (*errp) { +if (ERR_IS_SET (errp)) {object_unref (obj);return ; }for (e =qdict_first (qdict); e; e =qdict_next (qdict, e)) {object_property_set (obj, visitor, e->key, errp); -if (*errp) { +if (ERR_IS_SET (errp)) {break ; } } -if (!*errp) { +if (!ERR_IS_SET (errp)) {visit_check_struct (visitor, errp); }visit_end_struct (visitor,NULL );visit_free (visitor); -if (*errp) { +if (ERR_IS_SET (errp)) {object_unref (obj);return ; }
@@ -434,7 +434,7 @@ CpuModelExpansionInfo *arch_query_cpu_model_expansion(CpuModelExpansionType type/* convert it to our internal representation */ cpu_model_from_info (&s390_model, model, errp); -if (*errp) { +if (ERR_IS_SET (errp)) {return NULL ; }
@@ -474,11 +474,11 @@ CpuModelCompareInfo *arch_query_cpu_model_comparison(CpuModelInfo *infoa,/* convert both models to our internal representation */ cpu_model_from_info (&modela, infoa, errp); -if (*errp) { +if (ERR_IS_SET (errp)) {return NULL ; }cpu_model_from_info (&modelb, infob, errp); -if (*errp) { +if (ERR_IS_SET (errp)) {return NULL ; } compare_info =g_malloc0 (sizeof (*compare_info));
@@ -548,12 +548,12 @@ CpuModelBaselineInfo *arch_query_cpu_model_baseline(CpuModelInfo *infoa,/* convert both models to our internal representation */ cpu_model_from_info (&modela, infoa, errp); -if (*errp) { +if (ERR_IS_SET (errp)) {return NULL ; }cpu_model_from_info (&modelb, infob, errp); -if (*errp) { +if (ERR_IS_SET (errp)) {return NULL ; }
@@ -702,7 +702,7 @@ static S390CPUModel *get_max_cpu_model(Error **errp) S390_FEAT_MAX);add_qemu_cpu_model_features (max_model.features); } -if (!*errp) { +if (!ERR_IS_SET (errp)) { cached = true;return &max_model; }
@@ -732,7 +732,7 @@ static inline void apply_cpu_model(const S390CPUModel *model, Error **errp)/* FIXME TCG - use data for stdip/stfl */ } -if (!*errp) { +if (!ERR_IS_SET (errp)) { applied = true;if (model) { applied_model = *model;
@@ -759,7 +759,7 @@ void s390_realize_cpu_model(CPUState *cs, Error **errp) } max_model =get_max_cpu_model (errp); -if (*errp) { +if (ERR_IS_SET (errp)) {error_prepend (errp,"CPU models are not available: " );return ; }
@@ -771,7 +771,7 @@ void s390_realize_cpu_model(CPUState *cs, Error **errp)check_consistency (cpu->model);check_compatibility (max_model, cpu->model, errp); -if (*errp) { +if (ERR_IS_SET (errp)) {return ; }
@@ -814,7 +814,7 @@ static void set_feature(Object *obj, Visitor *v, const char *name, }visit_type_bool (v, name, &value, errp); -if (*errp) { +if (ERR_IS_SET (errp)) {return ; }if (value) {
@@ -871,7 +871,7 @@ static void set_feature_group(Object *obj, Visitor *v, const char *name, }visit_type_bool (v, name, &value, errp); -if (*errp) { +if (ERR_IS_SET (errp)) {return ; }if (value) {
target/s390x/helper.c +1 -1
@@ -98,7 +98,7 @@ S390CPU *cpu_s390x_create(const char *cpu_model, Error **errp) }g_free (name); -if (*errp) { +if (ERR_IS_SET (errp)) {return NULL ; }return S390_CPU (CPU (object_new (typename)));
tests/test-crypto-tlscredsx509.c +1 -1
@@ -54,7 +54,7 @@ static QCryptoTLSCreds *test_tls_creds_create(QCryptoTLSCredsEndpoint endpoint,"sanity-check" ,"yes" , NULL); -if (*errp) { +if (ERR_IS_SET (errp)) {return NULL ; }return QCRYPTO_TLS_CREDS (creds);
tests/test-io-channel-tls.c +1 -1
@@ -89,7 +89,7 @@ static QCryptoTLSCreds *test_tls_creds_create(QCryptoTLSCredsEndpoint endpoint,NULL ); -if (*errp) { +if (ERR_IS_SET (errp)) {return NULL ; }return QCRYPTO_TLS_CREDS (creds);
util/error.c +6 -6
@@ -51,10 +51,10 @@ static void error_setv(Error **errp,Error *err;int saved_errno = errno; -if (errp ==NULL ) { +if (ERR_IS_IGNORED (errp)) {return ; } -assert (*errp ==NULL ); +assert (!ERR_IS_SET (errp)); err =g_malloc0 (sizeof (*err)); err->msg =g_strdup_vprintf (fmt, ap);
@@ -103,7 +103,7 @@ void error_setg_errno_internal(Error **errp,va_list ap;int saved_errno = errno; -if (errp ==NULL ) { +if (ERR_IS_IGNORED (errp)) {return ; }
@@ -127,7 +127,7 @@ void error_vprepend(Error **errp, const char *fmt, va_list ap) {GString *newmsg; -if (!errp) { +if (ERR_IS_IGNORED (errp)) {return ; }
@@ -153,7 +153,7 @@ void error_append_hint(Error **errp, const char *fmt, ...)int saved_errno = errno;Error *err; -if (!errp) { +if (ERR_IS_IGNORED (errp)) {return ; } err = *errp;
@@ -178,7 +178,7 @@ void error_setg_win32_internal(Error **errp,va_list ap;char *suffix =NULL ; -if (errp ==NULL ) { +if (ERR_IS_IGNORED (errp)) {return ; }
Signature · 1 line
2.11.0.259.g40922b1
RFC 11/15 Manual changes to use ERR_IS_* macros
In reply to Eduardo HabkostChange code that was missed by the Coccinelle patch for some reason.
--- hw/core/qdev-properties.c | 2 +- hw/mem/pc-dimm.c | 2 +- migration/rdma.c | 2 +- util/error.c | 4 ++-- util/qemu-option.c | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-)
hw/core/qdev-properties.c +1 -1
@@ -1107,7 +1107,7 @@ static void qdev_prop_set_globals_for_type(DeviceState *dev,if (err !=NULL ) {error_prepend (&err,"can't apply global %s.%s=%s: " , prop->driver, prop->property, prop->value); -if (!dev->hotplugged && prop->errp) { +if (!dev->hotplugged && !ERR_IS_IGNORED (prop->errp)) {error_propagate (prop->errp, err); }else {assert (prop->user_provided);
hw/mem/pc-dimm.c +1 -1
@@ -139,7 +139,7 @@ static int pc_existing_dimms_capacity_internal(Object *obj, void *opaque) cap->errp); } -if (cap->errp && *cap->errp) { +if (!ERR_IS_IGNORED (cap->errp) &&ERR_IS_SET (cap->errp)) {return 1 ; } }
migration/rdma.c +1 -1
@@ -39,7 +39,7 @@#define ERROR (errp, fmt, ...) \ do { \ fprintf(stderr, "RDMA ERROR: " fmt "\n", ## __VA_ARGS__); \ - if (errp && (*(errp) == NULL)) { \ + if (!ERR_IS_IGNORED(errp) && !ERR_IS_SET(errp)) { \ error_setg(errp, "RDMA ERROR: " fmt, ## __VA_ARGS__); \ } \ } while (0)
util/error.c +2 -2
@@ -255,7 +255,7 @@ void error_free(Error *err)void error_free_or_abort (Error **errp) { -assert (errp && *errp); +assert (!ERR_IS_IGNORED (errp) &&ERR_IS_SET (errp));error_free (*errp); *errp =NULL ; }
@@ -266,7 +266,7 @@ void error_propagate(Error **dst_errp, Error *local_err)return ; }error_handle_fatal (dst_errp, local_err); -if (dst_errp && !*dst_errp) { +if (!ERR_IS_IGNORED (dst_errp) && !ERR_IS_SET (dst_errp)) { *dst_errp = local_err; }else {error_free (local_err);
util/qemu-option.c +3 -3
@@ -617,7 +617,7 @@ int qemu_opt_foreach(QemuOpts *opts, qemu_opt_loopfunc func, void *opaque,if (rc) {return rc; } -assert (!errp || !*errp); +assert (!ERR_IS_SET (errp)); }return 0 ; }
@@ -945,7 +945,7 @@ static void qemu_opts_from_qdict_1(const char *key, QObject *obj, void *opaque)const char *value;int n; -if (!strcmp (key,"id" ) || *state->errp) { +if (!strcmp (key,"id" ) ||ERR_IS_SET (state->errp)) {return ; }
@@ -1113,7 +1113,7 @@ int qemu_opts_foreach(QemuOptsList *list, qemu_opts_loopfunc func,if (rc) {break ; } -assert (!errp || !*errp); +assert (!ERR_IS_SET (errp)); }loc_pop (&loc);return rc;
Signature · 1 line
2.11.0.259.g40922b1
RFC 12/15 error: Make IGNORED_ERRORS not a NULL pointer
In reply to Eduardo HabkostUse a trick to make we have a non-NULL errp if IGNORED_ERRORS is used:
instead of passing NULL, pass an existing pointer that points to a special &error_ignored_unset value. This will let the error API to flag error state on *errp but won't require error_free() to be called later.
This will allow us to simplify the documented method to propagate errors from:
Error *err = NULL;
foo(arg, &err);
if (err) {
handle the error...
error_propagate(errp, err);
}to:
foo(arg, errp);
if (ERR_IS_SET(errp)) {
handle the error...
}This will allow us to stop using local_err variables and error_propagate() on hundreds of cases.
* TODO: API documentation needs to be updated.
* TODO: probably we should add assert(errp) lines to the ERR_IS_* macros, as err_set*() will now break if errp is NULL.
--- include/qapi/error.h | 20 +++++++++++++++++--- tests/test-qapi-util.c | 14 +++++++------- util/error.c | 13 ++++++++++++- 3 files changed, 36 insertions(+), 11 deletions(-)
include/qapi/error.h +17 -3
@@ -117,10 +117,24 @@#include "qapi-types.h" -#define IGNORE_ERRORS (NULL) -#define ERR_IS_SET (e) (!!*(e)) -#define ERR_IS_IGNORED (e) (!(e)) +/* +* Special error value to indicate errors will be ignored, and no +* error was set. +*/ +extern Error ignored_error_unset; + +/* +* Special error destination to indicate errors will be ignored, +* but an error value was set. +*/ +extern Error ignored_error_set; + + +#define IGNORE_ERRORS (& (Error *) { &ignored_error_unset }) + +#define ERR_IS_SET (e) (*(e) && *(e) != &ignored_error_unset) +#define ERR_IS_IGNORED (e) (!(e) || *(e) == &ignored_error_unset || *(e) == &ignored_error_set)/* * Overall category of an error.
tests/test-qapi-util.c +7 -7
@@ -77,25 +77,25 @@ static void test_parse_qapi_name(void)static void successfn (Error **errp) { -g_assert (ERR_IS_IGNORED (errp) || !ERR_IS_SET (errp)); +g_assert (!ERR_IS_SET (errp)); }static void fail1 (Error **errp) { -g_assert (ERR_IS_IGNORED (errp) || !ERR_IS_SET (errp)); +g_assert (!ERR_IS_SET (errp));error_setg (errp,"error1" ); -g_assert (ERR_IS_IGNORED (errp) ||ERR_IS_SET (errp)); +g_assert (ERR_IS_SET (errp)); }static void fail2 (Error **errp) { -g_assert (ERR_IS_IGNORED (errp) || !ERR_IS_SET (errp)); +g_assert (!ERR_IS_SET (errp));error_setg (errp,"error2" ); -g_assert (ERR_IS_IGNORED (errp) ||ERR_IS_SET (errp)); +g_assert (ERR_IS_SET (errp)); }static void multifn (Error **errp)
@@ -124,13 +124,13 @@ static void test_propagate(void (*fn)(Error **), Error **errp)bool failed;Error *local_err =NULL ; -g_assert (ERR_IS_IGNORED (errp) || !ERR_IS_SET (errp)); +g_assert (!ERR_IS_SET (errp));fn (&local_err); failed = !!local_err;error_propagate (errp, local_err); -g_assert (ERR_IS_IGNORED (errp) || (failed == !!ERR_IS_SET (errp))); +g_assert ((failed == !!ERR_IS_SET (errp))); }static void test_error_api (void )
util/error.c +12 -1
@@ -28,6 +28,8 @@ struct ErrorError *error_abort;Error *error_fatal; +Error ignored_error_unset; +Error ignored_error_set;static void error_handle_fatal (Error **errp,Error *err) {
@@ -52,6 +54,7 @@ static void error_setv(Error **errp,int saved_errno = errno;if (ERR_IS_IGNORED (errp)) { + *errp = &ignored_error_set;return ; }assert (!ERR_IS_SET (errp));
@@ -104,6 +107,7 @@ void error_setg_errno_internal(Error **errp,int saved_errno = errno;if (ERR_IS_IGNORED (errp)) { + *errp = &ignored_error_set;return ; }
@@ -127,6 +131,8 @@ void error_vprepend(Error **errp, const char *fmt, va_list ap) {GString *newmsg; +assert (ERR_IS_SET (errp)); +if (ERR_IS_IGNORED (errp)) {return ; }
@@ -153,6 +159,8 @@ void error_append_hint(Error **errp, const char *fmt, ...)int saved_errno = errno;Error *err; +assert (ERR_IS_SET (errp)); +if (ERR_IS_IGNORED (errp)) {return ; }
@@ -179,6 +187,7 @@ void error_setg_win32_internal(Error **errp,char *suffix =NULL ;if (ERR_IS_IGNORED (errp)) { + *errp = &ignored_error_set;return ; }
@@ -266,7 +275,9 @@ void error_propagate(Error **dst_errp, Error *local_err)return ; }error_handle_fatal (dst_errp, local_err); -if (!ERR_IS_IGNORED (dst_errp) && !ERR_IS_SET (dst_errp)) { +if (ERR_IS_IGNORED (dst_errp)) { + *dst_errp = &ignored_error_set; + }else if (!ERR_IS_SET (dst_errp)) { *dst_errp = local_err; }else {error_free (local_err);
Signature · 1 line
2.11.0.259.g40922b1
RFC 13/15 rdma: Simplify var declaration to avoid confusing Coccinelle
In reply to Eduardo HabkostFor some reason the declaration:
Error *local_err = NULL, **errp = &local_err;
will be matched by Coccinelle even if we use:
... when != local_err Error *local_err = NULL; ... when != local_err
This moves the declarations to separate lines just to avoid that issue.
--- migration/rdma.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
migration/rdma.c +6 -3
@@ -2282,7 +2282,8 @@ static void qemu_rdma_cleanup(RDMAContext *rdma)static int qemu_rdma_source_init (RDMAContext *rdma,bool pin_all,Error **errp) {int ret, idx; -Error *local_err =NULL , **temp = &local_err; +Error *local_err =NULL ; +Error **temp = &local_err;/* * Will be validated against destination's actual capabilities
@@ -3433,7 +3434,8 @@ static int qemu_rdma_registration_start(QEMUFile *f, void *opaque,static int qemu_rdma_registration_stop (QEMUFile *f,void *opaque,uint64_t flags,void *data) { -Error *local_err =NULL , **errp = &local_err; +Error *local_err =NULL ; +Error **errp = &local_err;QIOChannelRDMA *rioc =QIO_CHANNEL_RDMA (opaque);RDMAContext *rdma = rioc->rdma;RDMAControlHeader head = { .len =0 , .repeat =1 };
@@ -3606,7 +3608,8 @@ static void rdma_accept_incoming_migration(void *opaque)RDMAContext *rdma = opaque;int ret;QEMUFile *f; -Error *local_err =NULL , **errp = &local_err; +Error *local_err =NULL ; +Error **errp = &local_err;trace_qemu_rdma_accept_incoming_migration (); ret =qemu_rdma_accept (rdma);
Signature · 1 line
2.11.0.259.g40922b1
RFC 4/15 Use IGNORE_ERRORS instead of NULL as errp argument
In reply to Eduardo HabkostThis was generated by the following Coccinelle script with hardcoded function names. Probably there's a better way to catch calls to functions that accept an Error** argument, but I didn't find a reliable way to do that.
(Script can't be copied verbatim. The huge regexp below was split in multiple lines to make Git happy.)
@@
identifier F =~ "object(|_class)_property_(add|get|set|del|find).*|\
device_add_bootindex_property|memory_region_init_.*|\
object_property_find|qemu_chr_fe_init|numa_get_node|\
qbus_set_hotplug_handler|qdev_unplug|\
vmstate_register_with_alias_id|bdrv_refresh_limits|\
bdrv_create_dirty_bitmap|bdrv_reclaim_dirty_bitmap|\
blk_dev_change_media_cb|bdrv_lookup_bs|reopen_backing_file|\
bdrv_find_protocol|sd_truncate|qio_channel_socket_accept|\
block_job_finish_sync|qio_channel_(read|write)(|v)(|_full)|\
qio_channel_close|qio_channel_io_seek|qio_channel_command_abort|\
qio_channel_websock_(read|write)_wire|qio_task_propagate_error|\
qio_channel_socket_listen_sync|qio_channel_socket_new_fd|\
bdrv_reopen|blk_truncate|bdrv_truncate|bdrv_op_is_blocked|\
qcrypto_block_decrypt|qcrypto_block_get_info|raw_handle_perm_lock|\
qapi_enum_parse|qmp_(qom_list|query_.*|quit|stop|cont|system_.*|\
migrate_.*|change_vnc_password|nbd_server_stop|inject_nmi|\
guest_fsfreeze_thaw|marshal_.*)|qio_channel_shutdown|\
qio_channel_set_blocking|cryptodev_backend_cleanup|\
bdrv_dirty_bitmap_abdicate|qcrypto_block_decrypt|\
qcrypto_block_encrypt|iscsi_open|qcow2_read_extensions|\
qcrypto_hash_bytesv|replication_stop|visit_type_.*|\
qemu_opt(|s)_(set|create|foreach)$|v9fs_device_realize_common|\
msix_init_exclusive_bar|msi_init|qemu_input_handler_bind|\
pcie_aer_init|pci_qdev_unrealize|msix_init|usb_qdev_unrealize|\
usb_try_create_simple|usb_ehci_realize|.*_(|un)realize(|_common)|\
qdev_unplug|qapi_event_send_migration_pass|nbd_send_option_request|\
blk_invalidate_cache|socket_local_address|json_parser_parse_err|\
object_set_propv|vnc_socket_ip_addr_string|inet_connect_addr|\
opts_parse|migrate_add_blocker|nbd_wr_syncv|(read|write)_sync";
@@
F(...,
- NULL
+ IGNORE_ERRORS
) @@
expression T, P, ID, ERR;
@@
object_new_with_props(T, P, ID,
- NULL
+ IGNORE_ERRORS
)
@@
expression O, ERR;
@@
object_set_propv(O,
- NULL
+ IGNORE_ERRORS
)
--- include/hw/audio/pcspk.h | 2 +- include/hw/isa/isa.h | 3 +- include/migration/vmstate.h | 2 +- target/s390x/cpu.h | 2 +- backends/cryptodev.c | 6 ++-- backends/rng-egd.c | 2 +- backends/rng-random.c | 2 +- backends/rng.c | 2 +- backends/tpm.c | 2 +- block.c | 4 +-- block/backup.c | 6 ++-- block/block-backend.c | 2 +- block/commit.c | 14 ++++---- block/crypto.c | 2 +- block/file-posix.c | 4 +-- block/gluster.c | 2 +- block/iscsi.c | 4 +-- block/mirror.c | 6 ++-- block/nbd-client.c | 10 +++--- block/parallels.c | 7 ++-- block/qcow.c | 6 ++-- block/qcow2.c | 2 +- block/quorum.c | 2 +- block/replication.c | 10 +++--- block/sheepdog.c | 4 +-- block/stream.c | 4 +-- block/vhdx-log.c | 2 +- block/vhdx.c | 2 +- blockdev-nbd.c | 2 +- blockdev.c | 10 +++--- blockjob.c | 4 +-- bootdevice.c | 2 +- bsd-user/elfload.c | 3 +- chardev/char-fd.c | 2 +- chardev/char-io.c | 2 +- chardev/char-pty.c | 2 +- chardev/char-socket.c | 20 ++++++----- chardev/char-udp.c | 4 +-- crypto/secret.c | 12 +++---- crypto/tlscreds.c | 8 ++--- crypto/tlscredsanon.c | 2 +- crypto/tlscredsx509.c | 6 ++-- dump.c | 2 +- exec.c | 2 +- hmp.c | 68 ++++++++++++++++++------------------- hw/9pfs/xen-9p-backend.c | 11 +++--- hw/acpi/ich9.c | 14 ++++---- hw/acpi/memory_hotplug.c | 10 +++--- hw/acpi/nvdimm.c | 16 ++++----- hw/acpi/piix4.c | 14 ++++---- hw/acpi/vmgenid.c | 4 +-- hw/arm/allwinner-a10.c | 2 +- hw/arm/aspeed_soc.c | 23 +++++++------ hw/arm/bcm2835_peripherals.c | 30 +++++++++------- hw/arm/bcm2836.c | 3 +- hw/arm/digic.c | 7 ++-- hw/arm/exynos4210.c | 2 +- hw/arm/fsl-imx6.c | 32 ++++++++++------- hw/arm/highbank.c | 2 +- hw/arm/integratorcp.c | 2 +- hw/arm/realview.c | 2 +- hw/arm/versatilepb.c | 2 +- hw/arm/vexpress.c | 8 ++--- hw/arm/virt.c | 41 +++++++++++----------- hw/arm/xilinx_zynq.c | 2 +- hw/arm/xlnx-zynqmp.c | 4 +-- hw/block/fdc.c | 4 +-- hw/block/nvme.c | 2 +- hw/block/virtio-blk.c | 4 +-- hw/core/bus.c | 8 +++-- hw/core/platform-bus.c | 5 +-- hw/core/qdev-properties-system.c | 4 +-- hw/core/qdev.c | 24 +++++++------ hw/core/sysbus.c | 5 +-- hw/cpu/a15mpcore.c | 2 +- hw/cpu/a9mpcore.c | 2 +- hw/cpu/core.c | 4 +-- hw/display/vga-pci.c | 6 ++-- hw/i386/acpi-build.c | 51 ++++++++++++++++------------ hw/i386/kvm/pci-assign.c | 2 +- hw/i386/pc.c | 4 +-- hw/i386/pc_q35.c | 15 ++++---- hw/ide/ich.c | 2 +- hw/ide/qdev.c | 4 +-- hw/input/virtio-input-hid.c | 3 +- hw/intc/apic_common.c | 4 +-- hw/intc/arm_gicv3_common.c | 3 +- hw/intc/s390_flic.c | 2 +- hw/intc/s390_flic_kvm.c | 2 +- hw/ipmi/ipmi.c | 2 +- hw/isa/lpc_ich9.c | 6 ++-- hw/mem/nvdimm.c | 2 +- hw/mem/pc-dimm.c | 2 +- hw/microblaze/petalogix_ml605_mmu.c | 14 ++++---- hw/mips/boston.c | 2 +- hw/mips/mips_malta.c | 2 +- hw/misc/auxbus.c | 2 +- hw/misc/edu.c | 2 +- hw/misc/macio/macio.c | 4 +-- hw/misc/pvpanic.c | 2 +- hw/misc/tmp105.c | 2 +- hw/net/e1000.c | 2 +- hw/net/e1000e.c | 8 ++--- hw/net/eepro100.c | 2 +- hw/net/lance.c | 2 +- hw/net/ne2000-isa.c | 4 +-- hw/net/ne2000.c | 2 +- hw/net/pcnet-pci.c | 2 +- hw/net/rtl8139.c | 2 +- hw/net/spapr_llan.c | 2 +- hw/net/virtio-net.c | 2 +- hw/net/vmxnet3.c | 6 ++-- hw/nvram/fw_cfg.c | 3 +- hw/pci-host/gpex.c | 2 +- hw/pci-host/piix.c | 13 +++---- hw/pci-host/prep.c | 2 +- hw/pci-host/q35.c | 25 ++++++++------ hw/pci-host/xilinx-pcie.c | 4 +-- hw/pci/pci.c | 2 +- hw/pci/pcie.c | 2 +- hw/pci/shpc.c | 2 +- hw/pcmcia/pxa2xx.c | 2 +- hw/ppc/e500.c | 2 +- hw/ppc/pnv.c | 10 +++--- hw/ppc/pnv_core.c | 2 +- hw/ppc/pnv_psi.c | 3 +- hw/ppc/prep.c | 6 ++-- hw/ppc/spapr.c | 14 ++++---- hw/ppc/spapr_drc.c | 19 ++++++----- hw/ppc/spapr_iommu.c | 4 +-- hw/ppc/spapr_pci.c | 4 +-- hw/ppc/spapr_rng.c | 4 +-- hw/ppc/spapr_rtc.c | 3 +- hw/s390x/event-facility.c | 4 +-- hw/s390x/ipl.c | 3 +- hw/s390x/s390-pci-bus.c | 8 ++--- hw/s390x/s390-skeys.c | 6 ++-- hw/s390x/s390-virtio-ccw.c | 24 ++++++------- hw/s390x/s390-virtio.c | 2 +- hw/s390x/sclp.c | 7 ++-- hw/s390x/virtio-ccw.c | 4 +-- hw/scsi/megasas.c | 2 +- hw/scsi/scsi-bus.c | 8 ++--- hw/scsi/vhost-scsi.c | 2 +- hw/scsi/vmw_pvscsi.c | 2 +- hw/timer/mc146818rtc.c | 6 ++-- hw/usb/bus.c | 8 ++--- hw/usb/dev-hid.c | 3 +- hw/usb/dev-network.c | 2 +- hw/usb/dev-storage.c | 6 ++-- hw/usb/hcd-ehci-pci.c | 4 +-- hw/usb/hcd-xhci.c | 2 +- hw/usb/host-libusb.c | 2 +- hw/usb/redirect.c | 2 +- hw/vfio/pci.c | 2 +- hw/virtio/virtio-balloon.c | 4 +-- hw/virtio/virtio-crypto-pci.c | 2 +- hw/virtio/virtio-crypto.c | 2 +- hw/virtio/virtio-pci.c | 4 +-- hw/virtio/virtio-rng.c | 6 ++-- hw/virtio/virtio.c | 3 +- hw/xen/xen_pvdev.c | 2 +- io/channel-command.c | 2 +- io/channel-tls.c | 4 +-- linux-user/elfload.c | 3 +- linux-user/uname.c | 2 +- migration/block.c | 3 +- migration/colo.c | 4 +-- migration/qemu-file-channel.c | 10 +++--- migration/ram.c | 3 +- migration/socket.c | 2 +- monitor.c | 10 +++--- nbd/client.c | 4 +-- nbd/server.c | 18 +++++----- net/colo-compare.c | 6 ++-- net/dump.c | 4 +-- net/filter-buffer.c | 2 +- net/filter-mirror.c | 6 ++-- net/filter.c | 6 ++-- net/net.c | 6 ++-- numa.c | 7 ++-- qdev-monitor.c | 6 ++-- qemu-img.c | 24 ++++++------- qemu-io.c | 2 +- qemu-nbd.c | 4 +-- qga/commands-posix.c | 2 +- qga/main.c | 2 +- qobject/json-parser.c | 2 +- qom/container.c | 2 +- qom/object.c | 18 +++++----- qom/object_interfaces.c | 2 +- target/alpha/cpu.c | 2 +- target/arm/cpu64.c | 4 +-- target/hppa/cpu.c | 2 +- target/i386/cpu.c | 25 ++++++++------ target/m68k/helper.c | 2 +- target/microblaze/translate.c | 2 +- target/mips/translate.c | 2 +- target/nios2/cpu.c | 2 +- target/ppc/kvm.c | 3 +- target/s390x/cpu.c | 2 +- target/s390x/cpu_models.c | 17 ++++++---- target/s390x/kvm.c | 4 +-- target/sparc/cpu.c | 2 +- target/tilegx/cpu.c | 2 +- target/xtensa/helper.c | 2 +- tests/check-qom-proplist.c | 17 +++++----- tests/io-channel-helpers.c | 4 +-- tests/test-char.c | 2 +- tests/test-crypto-hash.c | 2 +- tests/test-io-channel-socket.c | 2 +- tests/test-io-channel-tls.c | 8 +++-- tests/test-qdev-global-props.c | 4 +-- tests/test-qemu-opts.c | 4 +-- tests/test-string-input-visitor.c | 12 +++---- tpm.c | 2 +- ui/gtk.c | 12 +++---- ui/input-linux.c | 6 ++-- ui/spice-core.c | 2 +- ui/vnc-auth-sasl.c | 4 +-- ui/vnc.c | 8 ++--- util/qemu-config.c | 6 ++-- util/qemu-option.c | 2 +- util/qemu-sockets.c | 3 +- vl.c | 5 +-- 225 files changed, 712 insertions(+), 628 deletions(-)
include/hw/audio/pcspk.h +1 -1
@@ -39,7 +39,7 @@ static inline ISADevice *pcspk_init(ISABus *bus, ISADevice *pit) isadev =isa_create (bus,TYPE_PC_SPEAKER ); dev =DEVICE (isadev);qdev_prop_set_uint32 (dev,"iobase" ,0x61 ); -object_property_set_link (OBJECT (dev),OBJECT (pit),"pit" ,NULL ); +object_property_set_link (OBJECT (dev),OBJECT (pit),"pit" ,IGNORE_ERRORS );qdev_init_nofail (dev);return isadev;
include/hw/isa/isa.h +2 -1
@@ -30,7 +30,8 @@ static inline uint16_t applesmc_port(void)Object *obj =object_resolve_path_type ("" ,TYPE_APPLE_SMC ,NULL );if (obj) { -return object_property_get_int (obj,APPLESMC_PROP_IO_BASE ,NULL ); +return object_property_get_int (obj,APPLESMC_PROP_IO_BASE , +IGNORE_ERRORS ); }return 0 ; }
include/migration/vmstate.h +1 -1
@@ -1033,7 +1033,7 @@ static inline int vmstate_register(DeviceState *dev, int instance_id, void *opaque) {return vmstate_register_with_alias_id (dev, instance_id, vmsd, - opaque,-1 ,0 ,NULL ); + opaque,-1 ,0 ,IGNORE_ERRORS ); } void vmstate_unregister(DeviceState *dev, const VMStateDescription *vmsd,
target/s390x/cpu.h +1 -1
@@ -1267,7 +1267,7 @@ static inline void s390_crypto_reset(void)static inline bool s390_get_squash_mcss (void ) {if (object_property_get_bool (OBJECT (qdev_get_machine ()),"s390-squash-mcss" , -NULL )) { +IGNORE_ERRORS )) {return true; }
backends/cryptodev.c +3 -3
@@ -225,16 +225,16 @@ static void cryptodev_backend_instance_init(Object *obj)object_property_add (obj,"queues" ,"int" , cryptodev_backend_get_queues, cryptodev_backend_set_queues, -NULL ,NULL ,NULL ); +NULL ,NULL ,IGNORE_ERRORS );/* Initialize devices' queues property to 1 */ -object_property_set_int (obj,1 ,"queues" ,NULL ); +object_property_set_int (obj,1 ,"queues" ,IGNORE_ERRORS ); }static void cryptodev_backend_finalize (Object *obj) {CryptoDevBackend *backend =CRYPTODEV_BACKEND (obj); -cryptodev_backend_cleanup (backend,NULL ); +cryptodev_backend_cleanup (backend,IGNORE_ERRORS ); } static void
backends/rng-egd.c +1 -1
@@ -138,7 +138,7 @@ static void rng_egd_init(Object *obj) {object_property_add_str (obj,"chardev" , rng_egd_get_chardev, rng_egd_set_chardev, -NULL ); +IGNORE_ERRORS ); }static void rng_egd_finalize (Object *obj)
backends/rng-random.c +1 -1
@@ -110,7 +110,7 @@ static void rng_random_init(Object *obj)object_property_add_str (obj,"filename" , rng_random_get_filename, rng_random_set_filename, -NULL ); +IGNORE_ERRORS ); s->filename =g_strdup ("/dev/random" ); s->fd =-1 ;
backends/rng.c +1 -1
@@ -108,7 +108,7 @@ static void rng_backend_init(Object *obj)object_property_add_bool (obj,"opened" , rng_backend_prop_get_opened, rng_backend_prop_set_opened, -NULL ); +IGNORE_ERRORS ); }static void rng_backend_finalize (Object *obj)
backends/tpm.c +1 -1
@@ -155,7 +155,7 @@ static void tpm_backend_instance_init(Object *obj)object_property_add_bool (obj,"opened" , tpm_backend_prop_get_opened, tpm_backend_prop_set_opened, -NULL ); +IGNORE_ERRORS ); }void tpm_backend_thread_deliver_request (TPMBackendThread *tbt)
block.c +2 -2
@@ -2096,7 +2096,7 @@ void bdrv_set_backing_hd(BlockDriverState *bs, BlockDriverState *backing_hd,bdrv_refresh_filename (bs); out: -bdrv_refresh_limits (bs,NULL ); +bdrv_refresh_limits (bs,IGNORE_ERRORS ); }/*
@@ -3002,7 +3002,7 @@ void bdrv_reopen_commit(BDRVReopenState *reopen_state) reopen_state->bs->open_flags = reopen_state->flags; reopen_state->bs->read_only = !(reopen_state->flags &BDRV_O_RDWR ); -bdrv_refresh_limits (reopen_state->bs,NULL ); +bdrv_refresh_limits (reopen_state->bs,IGNORE_ERRORS ); }/*
block/backup.c +3 -3
@@ -218,11 +218,11 @@ static void backup_cleanup_sync_bitmap(BackupBlockJob *job, int ret)if (ret <0 ||block_job_is_cancelled (&job->common)) {/* Merge the successor back into the parent, delete nothing. */ - bm =bdrv_reclaim_dirty_bitmap (bs, job->sync_bitmap,NULL ); + bm =bdrv_reclaim_dirty_bitmap (bs, job->sync_bitmap,IGNORE_ERRORS );assert (bm); }else {/* Everything is fine, delete this bitmap and install the backup. */ - bm =bdrv_dirty_bitmap_abdicate (bs, job->sync_bitmap,NULL ); + bm =bdrv_dirty_bitmap_abdicate (bs, job->sync_bitmap,IGNORE_ERRORS );assert (bm); } }
@@ -688,7 +688,7 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs, error:if (sync_bitmap) { -bdrv_reclaim_dirty_bitmap (bs, sync_bitmap,NULL ); +bdrv_reclaim_dirty_bitmap (bs, sync_bitmap,IGNORE_ERRORS ); }if (job) {backup_clean (&job->common);
block/block-backend.c +1 -1
@@ -819,7 +819,7 @@ void blk_dev_change_media_cb(BlockBackend *blk, bool load, Error **errp)static void blk_root_change_media (BdrvChild *child,bool load) { -blk_dev_change_media_cb (child->opaque, load,NULL ); +blk_dev_change_media_cb (child->opaque, load,IGNORE_ERRORS ); }/*
block/commit.c +7 -7
@@ -112,10 +112,10 @@ static void commit_complete(BlockJob *job, void *opaque)* to r/o). These reopens do not need to be atomic, since we won't abort * even on failure here */ if (s->base_flags !=bdrv_get_flags (base)) { -bdrv_reopen (base, s->base_flags,NULL ); +bdrv_reopen (base, s->base_flags,IGNORE_ERRORS ); }if (overlay_bs && s->orig_overlay_flags !=bdrv_get_flags (overlay_bs)) { -bdrv_reopen (overlay_bs, s->orig_overlay_flags,NULL ); +bdrv_reopen (overlay_bs, s->orig_overlay_flags,IGNORE_ERRORS ); }g_free (s->backing_file_str);blk_unref (s->top);
@@ -158,7 +158,7 @@ static void coroutine_fn commit_run(void *opaque) }if (base_len < s->common.len) { - ret =blk_truncate (s->base, s->common.len,NULL ); + ret =blk_truncate (s->base, s->common.len,IGNORE_ERRORS );if (ret) { goto out; }
@@ -459,8 +459,8 @@ int bdrv_commit(BlockDriverState *bs)return -ENOTSUP ; } -if (bdrv_op_is_blocked (bs,BLOCK_OP_TYPE_COMMIT_SOURCE ,NULL ) || -bdrv_op_is_blocked (bs->backing->bs,BLOCK_OP_TYPE_COMMIT_TARGET ,NULL )) { +if (bdrv_op_is_blocked (bs,BLOCK_OP_TYPE_COMMIT_SOURCE ,IGNORE_ERRORS ) || +bdrv_op_is_blocked (bs->backing->bs,BLOCK_OP_TYPE_COMMIT_TARGET ,IGNORE_ERRORS )) {return -EBUSY ; }
@@ -468,7 +468,7 @@ int bdrv_commit(BlockDriverState *bs) open_flags = bs->backing->bs->open_flags;if (ro) { -if (bdrv_reopen (bs->backing->bs, open_flags |BDRV_O_RDWR ,NULL )) { +if (bdrv_reopen (bs->backing->bs, open_flags |BDRV_O_RDWR ,IGNORE_ERRORS )) {return -EACCES ; } }
@@ -582,7 +582,7 @@ ro_cleanup:if (ro) {/* ignoring error return here */ -bdrv_reopen (bs->backing->bs, open_flags & ~BDRV_O_RDWR ,NULL ); +bdrv_reopen (bs->backing->bs, open_flags & ~BDRV_O_RDWR ,IGNORE_ERRORS ); }return ret;
block/crypto.c +1 -1
@@ -601,7 +601,7 @@ block_crypto_get_specific_info_luks(BlockDriverState *bs)ImageInfoSpecific *spec_info;QCryptoBlockInfo *info; - info =qcrypto_block_get_info (crypto->block,NULL ); + info =qcrypto_block_get_info (crypto->block,IGNORE_ERRORS );if (!info) {return NULL ; }
block/file-posix.c +2 -2
@@ -2175,14 +2175,14 @@ static int raw_check_perm(BlockDriverState *bs, uint64_t perm, uint64_t shared,static void raw_set_perm (BlockDriverState *bs,uint64_t perm,uint64_t shared) {BDRVRawState *s = bs->opaque; -raw_handle_perm_lock (bs,RAW_PL_COMMIT , perm, shared,NULL ); +raw_handle_perm_lock (bs,RAW_PL_COMMIT , perm, shared,IGNORE_ERRORS ); s->perm = perm; s->shared_perm = shared; }static void raw_abort_perm_update (BlockDriverState *bs) { -raw_handle_perm_lock (bs,RAW_PL_ABORT ,0 ,0 ,NULL ); +raw_handle_perm_lock (bs,RAW_PL_ABORT ,0 ,0 ,IGNORE_ERRORS ); }BlockDriver bdrv_file = {
block/gluster.c +1 -1
@@ -547,7 +547,7 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf, ptr ="inet" ;/* accept legacy "tcp" */ } type =qapi_enum_parse (SocketAddressType_lookup, ptr, -SOCKET_ADDRESS_TYPE__MAX ,-1 ,NULL ); +SOCKET_ADDRESS_TYPE__MAX ,-1 ,IGNORE_ERRORS );if (type !=SOCKET_ADDRESS_TYPE_INET && type !=SOCKET_ADDRESS_TYPE_UNIX ) { error_setg(&local_err,
block/iscsi.c +2 -2
@@ -1362,7 +1362,7 @@ static char *get_initiator_name(QemuOpts *opts)return g_strdup (name); } - uuid_info =qmp_query_uuid (NULL ); + uuid_info =qmp_query_uuid (IGNORE_ERRORS );if (strcmp (uuid_info->UUID,UUID_NONE ) ==0 ) { name =qemu_get_vm_name (); }else {
@@ -2111,7 +2111,7 @@ static int iscsi_create(const char *filename, QemuOpts *opts, Error **errp)error_propagate (errp, local_err); ret = -EINVAL ; }else { - ret =iscsi_open (bs, bs_options,0 ,NULL ); + ret =iscsi_open (bs, bs_options,0 ,IGNORE_ERRORS ); }QDECREF (bs_options);
block/mirror.c +3 -3
@@ -550,7 +550,7 @@ static void mirror_exit(BlockJob *job, void *opaque) }if (bdrv_get_flags (target_bs) !=bdrv_get_flags (to_replace)) { -bdrv_reopen (target_bs,bdrv_get_flags (to_replace),NULL ); +bdrv_reopen (target_bs,bdrv_get_flags (to_replace),IGNORE_ERRORS ); }/* The mirror job has no requests in flight any more, but we need to
@@ -729,7 +729,7 @@ static void coroutine_fn mirror_run(void *opaque) }if (s->bdev_length > base_length) { - ret =blk_truncate (s->target, s->bdev_length,NULL ); + ret =blk_truncate (s->target, s->bdev_length,IGNORE_ERRORS );if (ret <0 ) { goto immediate_exit; }
@@ -1322,6 +1322,6 @@ void commit_active_start(const char *job_id, BlockDriverState *bs, error_restore_flags:/* ignore error and errp for bdrv_reopen, because we want to propagate * the original error */ -bdrv_reopen (base, orig_base_flags,NULL ); +bdrv_reopen (base, orig_base_flags,IGNORE_ERRORS );return ; }
block/nbd-client.c +5 -5
@@ -56,7 +56,7 @@ static void nbd_teardown_connection(BlockDriverState *bs)/* finish any pending coroutines */ qio_channel_shutdown (client->ioc,QIO_CHANNEL_SHUTDOWN_BOTH , -NULL ); +IGNORE_ERRORS );BDRV_POLL_WHILE (bs, client->read_reply_co);nbd_client_detach_aio_context (bs);
@@ -145,7 +145,7 @@ static int nbd_co_send_request(BlockDriverState *bs, rc =nbd_send_request (s->ioc, request);if (rc >=0 ) { ret =nbd_wr_syncv (s->ioc, qiov->iov, qiov->niov, request->len, - false,NULL ); + false,IGNORE_ERRORS );if (ret != request->len) { rc = -EIO ; }
@@ -174,7 +174,7 @@ static void nbd_co_receive_reply(NBDClientSession *s, }else {if (qiov && reply->error ==0 ) { ret =nbd_wr_syncv (s->ioc, qiov->iov, qiov->niov, request->len, - true,NULL ); + true,IGNORE_ERRORS );if (ret != request->len) { reply->error =EIO ; }
@@ -382,7 +382,7 @@ int nbd_client_init(BlockDriverState *bs,/* NBD handshake */ logout ("session init %s\n" , export); -qio_channel_set_blocking (QIO_CHANNEL (sioc), true,NULL ); +qio_channel_set_blocking (QIO_CHANNEL (sioc), true,IGNORE_ERRORS ); ret = nbd_receive_negotiate(QIO_CHANNEL(sioc), export, &client->nbdflags,
@@ -413,7 +413,7 @@ int nbd_client_init(BlockDriverState *bs,/* Now that we're connected, set the socket to be non-blocking and * kick the reply mechanism. */ -qio_channel_set_blocking (QIO_CHANNEL (sioc), false,NULL ); +qio_channel_set_blocking (QIO_CHANNEL (sioc), false,IGNORE_ERRORS ); client->read_reply_co =qemu_coroutine_create (nbd_read_reply_entry, client);nbd_client_attach_aio_context (bs,bdrv_get_aio_context (bs));
block/parallels.c +4 -3
@@ -224,7 +224,7 @@ static int64_t allocate_clusters(BlockDriverState *bs, int64_t sector_num, }else { ret =bdrv_truncate (bs->file, (s->data_end + space) <<BDRV_SECTOR_BITS , -NULL ); +IGNORE_ERRORS ); }if (ret <0 ) {return ret;
@@ -699,7 +699,7 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags, }if (!(flags &BDRV_O_RESIZE ) || !bdrv_has_zero_init (bs->file->bs) || -bdrv_truncate (bs->file,bdrv_getlength (bs->file->bs),NULL ) !=0 ) { +bdrv_truncate (bs->file,bdrv_getlength (bs->file->bs),IGNORE_ERRORS ) !=0 ) { s->prealloc_mode =PRL_PREALLOC_MODE_FALLOCATE ; }
@@ -742,7 +742,8 @@ static void parallels_close(BlockDriverState *bs) }if (bs->open_flags &BDRV_O_RDWR ) { -bdrv_truncate (bs->file, s->data_end <<BDRV_SECTOR_BITS ,NULL ); +bdrv_truncate (bs->file, s->data_end <<BDRV_SECTOR_BITS , +IGNORE_ERRORS ); }g_free (s->bat_dirty_bmap);
block/qcow.c +4 -2
@@ -473,7 +473,8 @@ static uint64_t get_cluster_offset(BlockDriverState *bs,/* round to cluster size */ cluster_offset = (cluster_offset + s->cluster_size -1 ) & ~(s->cluster_size -1 ); -bdrv_truncate (bs->file, cluster_offset + s->cluster_size,NULL ); +bdrv_truncate (bs->file, cluster_offset + s->cluster_size, +IGNORE_ERRORS );/* if encrypted, we must initialize the cluster content which won't be written */ if (bs->encrypted &&
@@ -917,7 +918,8 @@ static int qcow_make_empty(BlockDriverState *bs)if (bdrv_pwrite_sync (bs->file, s->l1_table_offset, s->l1_table, l1_length) <0 )return -1 ; - ret =bdrv_truncate (bs->file, s->l1_table_offset + l1_length,NULL ); + ret =bdrv_truncate (bs->file, s->l1_table_offset + l1_length, +IGNORE_ERRORS );if (ret <0 )return ret;
block/qcow2.c +1 -1
@@ -929,7 +929,7 @@ static int qcow2_do_open(BlockDriverState *bs, QDict *options, int flags,if (s->incompatible_features & ~QCOW2_INCOMPAT_MASK ) {void *feature_table =NULL ;qcow2_read_extensions (bs, header.header_length, ext_end, - &feature_table,NULL ); + &feature_table,IGNORE_ERRORS );report_unsupported_feature (errp, feature_table, s->incompatible_features & ~QCOW2_INCOMPAT_MASK );
block/quorum.c +1 -1
@@ -385,7 +385,7 @@ static int quorum_compute_hash(QuorumAIOCB *acb, int i, QuorumVoteValue *hash)if (qcrypto_hash_bytesv (QCRYPTO_HASH_ALG_SHA256 , qiov->iov, qiov->niov, &data, &len, -NULL ) <0 ) { +IGNORE_ERRORS ) <0 ) {return -EINVAL ; }
block/replication.c +5 -5
@@ -142,7 +142,7 @@ static void replication_close(BlockDriverState *bs)BDRVReplicationState *s = bs->opaque;if (s->stage ==BLOCK_REPLICATION_RUNNING ) { -replication_stop (s->rs, false,NULL ); +replication_stop (s->rs, false,IGNORE_ERRORS ); }if (s->stage ==BLOCK_REPLICATION_FAILOVER ) {block_job_cancel_sync (s->active_disk->bs->job);
@@ -389,13 +389,13 @@ static void backup_job_cleanup(BlockDriverState *bs)BDRVReplicationState *s = bs->opaque;BlockDriverState *top_bs; - top_bs =bdrv_lookup_bs (s->top_id, s->top_id,NULL ); + top_bs =bdrv_lookup_bs (s->top_id, s->top_id,IGNORE_ERRORS );if (!top_bs) {return ; }bdrv_op_unblock_all (top_bs, s->blocker);error_free (s->blocker); -reopen_backing_file (bs, false,NULL ); +reopen_backing_file (bs, false,IGNORE_ERRORS ); }static void backup_job_completed (void *opaque,int ret)
@@ -516,11 +516,11 @@ static void replication_start(ReplicationState *rs, ReplicationMode mode,error_setg (&s->blocker,"Block device is in use by internal backup job" ); - top_bs =bdrv_lookup_bs (s->top_id, s->top_id,NULL ); + top_bs =bdrv_lookup_bs (s->top_id, s->top_id,IGNORE_ERRORS );if (!top_bs || !bdrv_is_root_node (top_bs) || !check_top_bs (top_bs, bs)) {error_setg (errp,"No top_bs or it is invalid" ); -reopen_backing_file (bs, false,NULL ); +reopen_backing_file (bs, false,IGNORE_ERRORS );aio_context_release (aio_context);return ; }
block/sheepdog.c +2 -2
@@ -2020,7 +2020,7 @@ static int sd_create(const char *filename, QemuOpts *opts,BlockDriver *drv;/* Currently, only Sheepdog backing image is supported. */ - drv =bdrv_find_protocol (backing_file, true,NULL ); + drv =bdrv_find_protocol (backing_file, true,IGNORE_ERRORS );if (!drv ||strcmp (drv->protocol_name,"sheepdog" ) !=0 ) {error_setg (errp,"backing_file must be a sheepdog image" ); ret = -EINVAL ;
@@ -2448,7 +2448,7 @@ static coroutine_fn int sd_co_writev(BlockDriverState *bs, int64_t sector_num,BDRVSheepdogState *s = bs->opaque;if (offset > s->inode.vdi_size) { - ret =sd_truncate (bs, offset,NULL ); + ret =sd_truncate (bs, offset,IGNORE_ERRORS );if (ret <0 ) {return ret; }
block/stream.c +2 -2
@@ -93,7 +93,7 @@ out:if (s->bs_flags !=bdrv_get_flags (bs)) {/* Give up write permissions before making it read-only */ blk_set_perm (job->blk,0 ,BLK_PERM_ALL , &error_abort); -bdrv_reopen (bs, s->bs_flags,NULL ); +bdrv_reopen (bs, s->bs_flags,IGNORE_ERRORS ); }g_free (s->backing_file_str);
@@ -280,6 +280,6 @@ void stream_start(const char *job_id, BlockDriverState *bs, fail:if (orig_bs_flags !=bdrv_get_flags (bs)) { -bdrv_reopen (bs, orig_bs_flags,NULL ); +bdrv_reopen (bs, orig_bs_flags,IGNORE_ERRORS ); } }
block/vhdx-log.c +1 -1
@@ -548,7 +548,7 @@ static int vhdx_log_flush(BlockDriverState *bs, BDRVVHDXState *s,if (new_file_size % (1024 *1024 )) {/* round up to nearest 1MB boundary */ new_file_size = ((new_file_size >>20 ) +1 ) <<20 ; -bdrv_truncate (bs->file, new_file_size,NULL ); +bdrv_truncate (bs->file, new_file_size,IGNORE_ERRORS ); } }qemu_vfree (desc_entries);
block/vhdx.c +1 -1
@@ -1171,7 +1171,7 @@ static int vhdx_allocate_block(BlockDriverState *bs, BDRVVHDXState *s,/* per the spec, the address for a block is in units of 1MB */ *new_offset =ROUND_UP (*new_offset,1024 *1024 ); -return bdrv_truncate (bs->file, *new_offset + s->block_size,NULL ); +return bdrv_truncate (bs->file, *new_offset + s->block_size,IGNORE_ERRORS ); }/*
blockdev-nbd.c +1 -1
@@ -38,7 +38,7 @@ static gboolean nbd_accept(QIOChannel *ioc, GIOCondition condition, } cioc =qio_channel_socket_accept (QIO_CHANNEL_SOCKET (ioc), -NULL ); +IGNORE_ERRORS );if (!cioc) {return TRUE; }
blockdev.c +5 -5
@@ -1377,7 +1377,7 @@ static BdrvDirtyBitmap *block_dirty_bitmap_lookup(const char *node,error_setg (errp,"Bitmap name cannot be NULL" );return NULL ; } - bs =bdrv_lookup_bs (node, node,NULL ); + bs =bdrv_lookup_bs (node, node,IGNORE_ERRORS );if (!bs) {error_setg (errp,"Node '%s' not found" , node);return NULL ;
@@ -1707,7 +1707,7 @@ static void external_snapshot_prepare(BlkActionState *common, }if (snapshot_node_name && -bdrv_lookup_bs (snapshot_node_name, snapshot_node_name,NULL )) { +bdrv_lookup_bs (snapshot_node_name, snapshot_node_name,IGNORE_ERRORS )) {error_setg (errp,"New snapshot node name already in use" );return ; }
@@ -1793,7 +1793,7 @@ static void external_snapshot_commit(BlkActionState *common)* don't want to abort all of them if one of them fails the reopen */ if (!state->old_bs->copy_on_read) {bdrv_reopen (state->old_bs, state->old_bs->open_flags & ~BDRV_O_RDWR , -NULL ); +IGNORE_ERRORS ); } }
@@ -2916,7 +2916,7 @@ void qmp_block_resize(bool has_device, const char *device, goto out; } -if (bdrv_op_is_blocked (bs,BLOCK_OP_TYPE_RESIZE ,NULL )) { +if (bdrv_op_is_blocked (bs,BLOCK_OP_TYPE_RESIZE ,IGNORE_ERRORS )) {error_setg (errp,QERR_DEVICE_IN_USE , device); goto out; }
@@ -3055,7 +3055,7 @@ void qmp_block_commit(bool has_job_id, const char *job_id, const char *device,* scenario in which all optional arguments are omitted. */ bs =qmp_get_root_bs (device, &local_err);if (!bs) { - bs =bdrv_lookup_bs (device, device,NULL ); + bs =bdrv_lookup_bs (device, device,IGNORE_ERRORS );if (!bs) {error_free (local_err); error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND,
blockjob.c +2 -2
@@ -419,7 +419,7 @@ static void block_job_completed_txn_abort(BlockJob *job) ctx =blk_get_aio_context (other_job->blk);if (!other_job->completed) {assert (other_job->cancelled); -block_job_finish_sync (other_job,NULL ,NULL ); +block_job_finish_sync (other_job,NULL ,IGNORE_ERRORS ); }block_job_completed_single (other_job);aio_context_release (ctx);
@@ -523,7 +523,7 @@ static void block_job_cancel_err(BlockJob *job, Error **errp)int block_job_cancel_sync (BlockJob *job) { -return block_job_finish_sync (job, &block_job_cancel_err,NULL ); +return block_job_finish_sync (job, &block_job_cancel_err,IGNORE_ERRORS ); }void block_job_cancel_sync_all (void )
bootdevice.c +1 -1
@@ -338,5 +338,5 @@ void device_add_bootindex_property(Object *obj, int32_t *bootindex,return ; }/* initialize devices' bootindex property to -1 */ -object_property_set_int (obj,-1 , name,NULL ); +object_property_set_int (obj,-1 , name,IGNORE_ERRORS ); }
bsd-user/elfload.c +2 -1
@@ -93,7 +93,8 @@ enum {static const char *get_elf_platform (void ) {static char elf_platform[] ="i386" ; -int family =object_property_get_int (OBJECT (thread_cpu),"family" ,NULL ); +int family =object_property_get_int (OBJECT (thread_cpu),"family" , +IGNORE_ERRORS );if (family >6 ) family =6 ;if (family >=3 )
chardev/char-fd.c +1 -1
@@ -56,7 +56,7 @@ static gboolean fd_chr_read(QIOChannel *chan, GIOCondition cond, void *opaque) } ret =qio_channel_read ( - chan, (gchar *)buf, len,NULL ); + chan, (gchar *)buf, len,IGNORE_ERRORS );if (ret ==0 ) {remove_fd_in_watch (chr);qemu_chr_be_event (chr,CHR_EVENT_CLOSED );
chardev/char-io.c +1 -1
@@ -161,7 +161,7 @@ int io_channel_send_full(QIOChannel *ioc, ret =qio_channel_writev_full ( ioc, &iov,1 , - fds, nfds,NULL ); + fds, nfds,IGNORE_ERRORS );if (ret ==QIO_CHANNEL_ERR_BLOCK ) {if (offset) {return offset;
chardev/char-pty.c +1 -1
@@ -168,7 +168,7 @@ static gboolean pty_chr_read(QIOChannel *chan, GIOCondition cond, void *opaque)if (len ==0 ) {return TRUE; } - ret =qio_channel_read (s->ioc, (char *)buf, len,NULL ); + ret =qio_channel_read (s->ioc, (char *)buf, len,IGNORE_ERRORS );if (ret <=0 ) {pty_chr_state (chr,0 );return FALSE;
chardev/char-socket.c +11 -9
@@ -276,11 +276,11 @@ static ssize_t tcp_chr_recv(Chardev *chr, char *buf, size_t len)if (qio_channel_has_feature (s->ioc,QIO_CHANNEL_FEATURE_FD_PASS )) { ret =qio_channel_readv_full (s->ioc, &iov,1 , &msgfds, &msgfds_num, -NULL ); +IGNORE_ERRORS ); }else { ret =qio_channel_readv_full (s->ioc, &iov,1 ,NULL ,NULL , -NULL ); +IGNORE_ERRORS ); }if (ret ==QIO_CHANNEL_ERR_BLOCK ) {
@@ -550,7 +550,7 @@ static gboolean tcp_chr_telnet_init_io(QIOChannel *ioc,TCPChardevTelnetInit *init = user_data;ssize_t ret; - ret =qio_channel_write (ioc, init->buf, init->buflen,NULL ); + ret =qio_channel_write (ioc, init->buf, init->buflen,IGNORE_ERRORS );if (ret <0 ) {if (ret ==QIO_CHANNEL_ERR_BLOCK ) { ret =0 ;
@@ -620,7 +620,7 @@ static void tcp_chr_tls_handshake(QIOTask *task,Chardev *chr = user_data;SocketChardev *s = user_data; -if (qio_task_propagate_error (task,NULL )) { +if (qio_task_propagate_error (task,IGNORE_ERRORS )) {tcp_chr_disconnect (chr); }else {/* tn3270 does not support TLS yet */
@@ -697,7 +697,7 @@ static int tcp_chr_new_client(Chardev *chr, QIOChannelSocket *sioc) s->sioc = sioc;object_ref (OBJECT (sioc)); -qio_channel_set_blocking (s->ioc, false,NULL ); +qio_channel_set_blocking (s->ioc, false,IGNORE_ERRORS );if (s->do_nodelay) {qio_channel_set_delay (s->ioc, false);
@@ -726,7 +726,7 @@ static int tcp_chr_add_client(Chardev *chr, int fd)int ret;QIOChannelSocket *sioc; - sioc =qio_channel_socket_new_fd (fd,NULL ); + sioc =qio_channel_socket_new_fd (fd,IGNORE_ERRORS );if (!sioc) {return -1 ; }
@@ -744,7 +744,7 @@ static gboolean tcp_chr_accept(QIOChannel *channel,QIOChannelSocket *sioc; sioc =qio_channel_socket_accept (QIO_CHANNEL_SOCKET (channel), -NULL ); +IGNORE_ERRORS );if (!sioc) {return TRUE; }
@@ -767,9 +767,11 @@ static int tcp_chr_wait_connected(Chardev *chr, Error **errp)if (s->is_listen) {error_report ("QEMU waiting for connection on: %s" , chr->filename); -qio_channel_set_blocking (QIO_CHANNEL (s->listen_ioc), true,NULL ); +qio_channel_set_blocking (QIO_CHANNEL (s->listen_ioc), true, +IGNORE_ERRORS );tcp_chr_accept (QIO_CHANNEL (s->listen_ioc),G_IO_IN , chr); -qio_channel_set_blocking (QIO_CHANNEL (s->listen_ioc), false,NULL ); +qio_channel_set_blocking (QIO_CHANNEL (s->listen_ioc), false, +IGNORE_ERRORS ); }else { sioc =qio_channel_socket_new ();tcp_chr_set_client_ioc_name (chr, sioc);
chardev/char-udp.c +2 -2
@@ -48,7 +48,7 @@ static int udp_chr_write(Chardev *chr, const uint8_t *buf, int len)UdpChardev *s =UDP_CHARDEV (chr);return qio_channel_write ( - s->ioc, (const char *)buf, len,NULL ); + s->ioc, (const char *)buf, len,IGNORE_ERRORS ); }static void udp_chr_flush_buffer (UdpChardev *s)
@@ -88,7 +88,7 @@ static gboolean udp_chr_read(QIOChannel *chan, GIOCondition cond, void *opaque)return TRUE; } ret =qio_channel_read ( - s->ioc, (char *)s->buf,sizeof (s->buf),NULL ); + s->ioc, (char *)s->buf,sizeof (s->buf),IGNORE_ERRORS );if (ret <=0 ) {remove_fd_in_watch (chr);return FALSE;
crypto/secret.c +6 -6
@@ -375,29 +375,29 @@ qcrypto_secret_class_init(ObjectClass *oc, void *data)object_class_property_add_bool (oc,"loaded" , qcrypto_secret_prop_get_loaded, qcrypto_secret_prop_set_loaded, -NULL ); +IGNORE_ERRORS );object_class_property_add_enum (oc,"format" ,"QCryptoSecretFormat" , QCryptoSecretFormat_lookup, qcrypto_secret_prop_get_format, qcrypto_secret_prop_set_format, -NULL ); +IGNORE_ERRORS );object_class_property_add_str (oc,"data" , qcrypto_secret_prop_get_data, qcrypto_secret_prop_set_data, -NULL ); +IGNORE_ERRORS );object_class_property_add_str (oc,"file" , qcrypto_secret_prop_get_file, qcrypto_secret_prop_set_file, -NULL ); +IGNORE_ERRORS );object_class_property_add_str (oc,"keyid" , qcrypto_secret_prop_get_keyid, qcrypto_secret_prop_set_keyid, -NULL ); +IGNORE_ERRORS );object_class_property_add_str (oc,"iv" , qcrypto_secret_prop_get_iv, qcrypto_secret_prop_set_iv, -NULL ); +IGNORE_ERRORS ); }
crypto/tlscreds.c +4 -4
@@ -226,21 +226,21 @@ qcrypto_tls_creds_class_init(ObjectClass *oc, void *data)object_class_property_add_bool (oc,"verify-peer" , qcrypto_tls_creds_prop_get_verify, qcrypto_tls_creds_prop_set_verify, -NULL ); +IGNORE_ERRORS );object_class_property_add_str (oc,"dir" , qcrypto_tls_creds_prop_get_dir, qcrypto_tls_creds_prop_set_dir, -NULL ); +IGNORE_ERRORS );object_class_property_add_enum (oc,"endpoint" ,"QCryptoTLSCredsEndpoint" , QCryptoTLSCredsEndpoint_lookup, qcrypto_tls_creds_prop_get_endpoint, qcrypto_tls_creds_prop_set_endpoint, -NULL ); +IGNORE_ERRORS );object_class_property_add_str (oc,"priority" , qcrypto_tls_creds_prop_get_priority, qcrypto_tls_creds_prop_set_priority, -NULL ); +IGNORE_ERRORS ); }
crypto/tlscredsanon.c +1 -1
@@ -191,7 +191,7 @@ qcrypto_tls_creds_anon_class_init(ObjectClass *oc, void *data)object_class_property_add_bool (oc,"loaded" , qcrypto_tls_creds_anon_prop_get_loaded, qcrypto_tls_creds_anon_prop_set_loaded, -NULL ); +IGNORE_ERRORS ); }
crypto/tlscredsx509.c +3 -3
@@ -833,15 +833,15 @@ qcrypto_tls_creds_x509_class_init(ObjectClass *oc, void *data)object_class_property_add_bool (oc,"loaded" , qcrypto_tls_creds_x509_prop_get_loaded, qcrypto_tls_creds_x509_prop_set_loaded, -NULL ); +IGNORE_ERRORS );object_class_property_add_bool (oc,"sanity-check" , qcrypto_tls_creds_x509_prop_get_sanity, qcrypto_tls_creds_x509_prop_set_sanity, -NULL ); +IGNORE_ERRORS );object_class_property_add_str (oc,"passwordid" , qcrypto_tls_creds_x509_prop_get_passwordid, qcrypto_tls_creds_x509_prop_set_passwordid, -NULL ); +IGNORE_ERRORS ); }
dump.c +1 -1
@@ -1681,7 +1681,7 @@ static void dump_process(DumpState *s, Error **errp) (local_err ? DUMP_STATUS_FAILED : DUMP_STATUS_COMPLETED));/* send DUMP_COMPLETED message (unconditionally) */ - result =qmp_query_dump (NULL ); + result =qmp_query_dump (IGNORE_ERRORS );/* should never fail */ assert (result); qapi_event_send_dump_completed(result, !!local_err, (local_err ? \
exec.c +1 -1
@@ -1404,7 +1404,7 @@ static int find_max_supported_pagesize(Object *obj, void *opaque)long *hpsize_min = opaque;if (object_dynamic_cast (obj,TYPE_MEMORY_BACKEND )) { - mem_path =object_property_get_str (obj,"mem-path" ,NULL ); + mem_path =object_property_get_str (obj,"mem-path" ,IGNORE_ERRORS );if (mem_path) {long hpsize =qemu_mempath_getpagesize (mem_path);if (hpsize < *hpsize_min) {
hmp.c +34 -34
260 lines not on this page · raw message
hw/9pfs/xen-9p-backend.c +6 -5
@@ -401,13 +401,14 @@ static int xen_9pfs_connect(struct XenDevice *xendev)v9fs_register_transport (s, &xen_9p_transport); fsdev =qemu_opts_create (qemu_find_opts ("fsdev" ), s->fsconf.tag, -1 ,NULL ); -qemu_opt_set (fsdev,"fsdriver" ,"local" ,NULL ); -qemu_opt_set (fsdev,"path" , xen_9pdev->path,NULL ); -qemu_opt_set (fsdev,"security_model" , xen_9pdev->security_model,NULL ); +1 ,IGNORE_ERRORS ); +qemu_opt_set (fsdev,"fsdriver" ,"local" ,IGNORE_ERRORS ); +qemu_opt_set (fsdev,"path" , xen_9pdev->path,IGNORE_ERRORS ); +qemu_opt_set (fsdev,"security_model" , xen_9pdev->security_model, +IGNORE_ERRORS );qemu_opts_set_id (fsdev, s->fsconf.fsdev_id);qemu_fsdev_add (fsdev); -v9fs_device_realize_common (s,NULL ); +v9fs_device_realize_common (s,IGNORE_ERRORS );return 0 ;
hw/acpi/ich9.c +7 -7
@@ -455,33 +455,33 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm, Error **errp) &pm->pm_io_base, errp);object_property_add (obj,ACPI_PM_PROP_GPE0_BLK ,"uint32" , ich9_pm_get_gpe0_blk, -NULL ,NULL , pm,NULL ); +NULL ,NULL , pm,IGNORE_ERRORS );object_property_add_uint32_ptr (obj,ACPI_PM_PROP_GPE0_BLK_LEN , &gpe0_len, errp);object_property_add_bool (obj,"memory-hotplug-support" , ich9_pm_get_memory_hotplug_support, ich9_pm_set_memory_hotplug_support, -NULL ); +IGNORE_ERRORS );object_property_add_bool (obj,"cpu-hotplug-legacy" , ich9_pm_get_cpu_hotplug_legacy, ich9_pm_set_cpu_hotplug_legacy, -NULL ); +IGNORE_ERRORS );object_property_add (obj,ACPI_PM_PROP_S3_DISABLED ,"uint8" , ich9_pm_get_disable_s3, ich9_pm_set_disable_s3, -NULL , pm,NULL ); +NULL , pm,IGNORE_ERRORS );object_property_add (obj,ACPI_PM_PROP_S4_DISABLED ,"uint8" , ich9_pm_get_disable_s4, ich9_pm_set_disable_s4, -NULL , pm,NULL ); +NULL , pm,IGNORE_ERRORS );object_property_add (obj,ACPI_PM_PROP_S4_VAL ,"uint8" , ich9_pm_get_s4_val, ich9_pm_set_s4_val, -NULL , pm,NULL ); +NULL , pm,IGNORE_ERRORS );object_property_add_bool (obj,ACPI_PM_PROP_TCO_ENABLED , ich9_pm_get_enable_tco, ich9_pm_set_enable_tco, -NULL ); +IGNORE_ERRORS ); } void ich9_pm_device_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,
hw/acpi/memory_hotplug.c +5 -5
@@ -84,23 +84,23 @@ static uint64_t acpi_memory_hotplug_read(void *opaque, hwaddr addr, o =OBJECT (mdev->dimm);switch (addr) {case 0x0 :/* Lo part of phys address where DIMM is mapped */ - val = o ?object_property_get_int (o,PC_DIMM_ADDR_PROP ,NULL ) :0 ; + val = o ?object_property_get_int (o,PC_DIMM_ADDR_PROP ,IGNORE_ERRORS ) :0 ;trace_mhp_acpi_read_addr_lo (mem_st->selector, val);break ;case 0x4 :/* Hi part of phys address where DIMM is mapped */ - val = o ?object_property_get_int (o,PC_DIMM_ADDR_PROP ,NULL ) >>32 :0 ; + val = o ?object_property_get_int (o,PC_DIMM_ADDR_PROP ,IGNORE_ERRORS ) >>32 :0 ;trace_mhp_acpi_read_addr_hi (mem_st->selector, val);break ;case 0x8 :/* Lo part of DIMM size */ - val = o ?object_property_get_int (o,PC_DIMM_SIZE_PROP ,NULL ) :0 ; + val = o ?object_property_get_int (o,PC_DIMM_SIZE_PROP ,IGNORE_ERRORS ) :0 ;trace_mhp_acpi_read_size_lo (mem_st->selector, val);break ;case 0xc :/* Hi part of DIMM size */ - val = o ?object_property_get_int (o,PC_DIMM_SIZE_PROP ,NULL ) >>32 :0 ; + val = o ?object_property_get_int (o,PC_DIMM_SIZE_PROP ,IGNORE_ERRORS ) >>32 :0 ;trace_mhp_acpi_read_size_hi (mem_st->selector, val);break ;case 0x10 :/* node proximity for _PXM method */ - val = o ?object_property_get_int (o,PC_DIMM_NODE_PROP ,NULL ) :0 ; + val = o ?object_property_get_int (o,PC_DIMM_NODE_PROP ,IGNORE_ERRORS ) :0 ;trace_mhp_acpi_read_pxm (mem_st->selector, val);break ;case 0x14 :/* pack and return is_* fields */
hw/acpi/nvdimm.c +8 -8
@@ -220,7 +220,7 @@ static NVDIMMDevice *nvdimm_get_device_by_handle(uint32_t handle)for (list = device_list; list; list = list->next) {NVDIMMDevice *nvd = list->data;int slot =object_property_get_int (OBJECT (nvd),PC_DIMM_SLOT_PROP , -NULL ); +IGNORE_ERRORS );if (nvdimm_slot_to_handle (slot) == handle) { nvdimm = nvd;
@@ -238,13 +238,13 @@ nvdimm_build_structure_spa(GArray *structures, DeviceState *dev) {NvdimmNfitSpa *nfit_spa;uint64_t addr =object_property_get_int (OBJECT (dev),PC_DIMM_ADDR_PROP , -NULL ); +IGNORE_ERRORS );uint64_t size =object_property_get_int (OBJECT (dev),PC_DIMM_SIZE_PROP , -NULL ); +IGNORE_ERRORS );uint32_t node =object_property_get_int (OBJECT (dev),PC_DIMM_NODE_PROP , -NULL ); +IGNORE_ERRORS );int slot =object_property_get_int (OBJECT (dev),PC_DIMM_SLOT_PROP , -NULL ); +IGNORE_ERRORS ); nfit_spa =acpi_data_push (structures,sizeof (*nfit_spa));
@@ -286,9 +286,9 @@ nvdimm_build_structure_memdev(GArray *structures, DeviceState *dev) {NvdimmNfitMemDev *nfit_memdev;uint64_t size =object_property_get_int (OBJECT (dev),PC_DIMM_SIZE_PROP , -NULL ); +IGNORE_ERRORS );int slot =object_property_get_int (OBJECT (dev),PC_DIMM_SLOT_PROP , -NULL ); +IGNORE_ERRORS );uint32_t handle =nvdimm_slot_to_handle (slot); nfit_memdev =acpi_data_push (structures,sizeof (*nfit_memdev));
@@ -322,7 +322,7 @@ static void nvdimm_build_structure_dcr(GArray *structures, DeviceState *dev) {NvdimmNfitControlRegion *nfit_dcr;int slot =object_property_get_int (OBJECT (dev),PC_DIMM_SLOT_PROP , -NULL ); +IGNORE_ERRORS );uint32_t sn =nvdimm_slot_to_sn (slot); nfit_dcr =acpi_data_push (structures,sizeof (*nfit_dcr));
hw/acpi/piix4.c +7 -7
@@ -480,17 +480,17 @@ static void piix4_pm_add_propeties(PIIX4PMState *s)static const uint16_t sci_int =9 ;object_property_add_uint8_ptr (OBJECT (s),ACPI_PM_PROP_ACPI_ENABLE_CMD , - &acpi_enable_cmd,NULL ); + &acpi_enable_cmd,IGNORE_ERRORS );object_property_add_uint8_ptr (OBJECT (s),ACPI_PM_PROP_ACPI_DISABLE_CMD , - &acpi_disable_cmd,NULL ); + &acpi_disable_cmd,IGNORE_ERRORS );object_property_add_uint32_ptr (OBJECT (s),ACPI_PM_PROP_GPE0_BLK , - &gpe0_blk,NULL ); + &gpe0_blk,IGNORE_ERRORS );object_property_add_uint32_ptr (OBJECT (s),ACPI_PM_PROP_GPE0_BLK_LEN , - &gpe0_blk_len,NULL ); + &gpe0_blk_len,IGNORE_ERRORS );object_property_add_uint16_ptr (OBJECT (s),ACPI_PM_PROP_SCI_INT , - &sci_int,NULL ); + &sci_int,IGNORE_ERRORS );object_property_add_uint32_ptr (OBJECT (s),ACPI_PM_PROP_PM_IO_BASE , - &s->io_base,NULL ); + &s->io_base,IGNORE_ERRORS ); }static void piix4_pm_realize (PCIDevice *dev,Error **errp)
@@ -646,7 +646,7 @@ static void piix4_acpi_system_hot_add_init(MemoryRegion *parent,object_property_add_bool (OBJECT (s),"cpu-hotplug-legacy" , piix4_get_cpu_hotplug_legacy, piix4_set_cpu_hotplug_legacy, -NULL ); +IGNORE_ERRORS );legacy_acpi_cpu_hotplug_init (parent,OBJECT (s), &s->gpe_cpu,PIIX4_CPU_HOTPLUG_IO_BASE );
hw/acpi/vmgenid.c +2 -2
@@ -243,11 +243,11 @@ static void vmgenid_device_class_init(ObjectClass *klass, void *data) dc->props = vmgenid_properties;object_class_property_add_str (klass,VMGENID_GUID ,NULL , - vmgenid_set_guid,NULL ); + vmgenid_set_guid,IGNORE_ERRORS );object_class_property_set_description (klass,VMGENID_GUID ,"Set Global Unique Identifier " "(big-endian) or auto for random value" , -NULL ); +IGNORE_ERRORS ); }static const TypeInfo vmgenid_device_info = {
hw/arm/allwinner-a10.c +1 -1
@@ -28,7 +28,7 @@ static void aw_a10_init(Object *obj)AwA10State *s =AW_A10 (obj);object_initialize (&s->cpu,sizeof (s->cpu),"cortex-a8-" TYPE_ARM_CPU ); -object_property_add_child (obj,"cpu" ,OBJECT (&s->cpu),NULL ); +object_property_add_child (obj,"cpu" ,OBJECT (&s->cpu),IGNORE_ERRORS );object_initialize (&s->intc,sizeof (s->intc),TYPE_AW_A10_PIC );qdev_set_parent_bus (DEVICE (&s->intc),sysbus_get_default ());
hw/arm/aspeed_soc.c +13 -10
@@ -129,23 +129,24 @@ static void aspeed_soc_init(Object *obj) cpu_typename =g_strdup_printf ("%s-" TYPE_ARM_CPU , sc->info->cpu_model);object_initialize (&s->cpu,sizeof (s->cpu), cpu_typename); -object_property_add_child (obj,"cpu" ,OBJECT (&s->cpu),NULL ); +object_property_add_child (obj,"cpu" ,OBJECT (&s->cpu),IGNORE_ERRORS );g_free (cpu_typename);object_initialize (&s->vic,sizeof (s->vic),TYPE_ASPEED_VIC ); -object_property_add_child (obj,"vic" ,OBJECT (&s->vic),NULL ); +object_property_add_child (obj,"vic" ,OBJECT (&s->vic),IGNORE_ERRORS );qdev_set_parent_bus (DEVICE (&s->vic),sysbus_get_default ());object_initialize (&s->timerctrl,sizeof (s->timerctrl),TYPE_ASPEED_TIMER ); -object_property_add_child (obj,"timerctrl" ,OBJECT (&s->timerctrl),NULL ); +object_property_add_child (obj,"timerctrl" ,OBJECT (&s->timerctrl), +IGNORE_ERRORS );qdev_set_parent_bus (DEVICE (&s->timerctrl),sysbus_get_default ());object_initialize (&s->i2c,sizeof (s->i2c),TYPE_ASPEED_I2C ); -object_property_add_child (obj,"i2c" ,OBJECT (&s->i2c),NULL ); +object_property_add_child (obj,"i2c" ,OBJECT (&s->i2c),IGNORE_ERRORS );qdev_set_parent_bus (DEVICE (&s->i2c),sysbus_get_default ());object_initialize (&s->scu,sizeof (s->scu),TYPE_ASPEED_SCU ); -object_property_add_child (obj,"scu" ,OBJECT (&s->scu),NULL ); +object_property_add_child (obj,"scu" ,OBJECT (&s->scu),IGNORE_ERRORS );qdev_set_parent_bus (DEVICE (&s->scu),sysbus_get_default ());qdev_prop_set_uint32 (DEVICE (&s->scu),"silicon-rev" , sc->info->silicon_rev);
@@ -155,7 +156,7 @@ static void aspeed_soc_init(Object *obj) "hw-strap2", &error_abort);object_initialize (&s->fmc,sizeof (s->fmc), sc->info->fmc_typename); -object_property_add_child (obj,"fmc" ,OBJECT (&s->fmc),NULL ); +object_property_add_child (obj,"fmc" ,OBJECT (&s->fmc),IGNORE_ERRORS );qdev_set_parent_bus (DEVICE (&s->fmc),sysbus_get_default ());object_property_add_alias (obj,"num-cs" ,OBJECT (&s->fmc),"num-cs" , &error_abort);
@@ -163,12 +164,13 @@ static void aspeed_soc_init(Object *obj)for (i =0 ; i < sc->info->spis_num; i++) {object_initialize (&s->spi[i],sizeof (s->spi[i]), sc->info->spi_typename[i]); -object_property_add_child (obj,"spi[*]" ,OBJECT (&s->spi[i]),NULL ); +object_property_add_child (obj,"spi[*]" ,OBJECT (&s->spi[i]), +IGNORE_ERRORS );qdev_set_parent_bus (DEVICE (&s->spi[i]),sysbus_get_default ()); }object_initialize (&s->sdmc,sizeof (s->sdmc),TYPE_ASPEED_SDMC ); -object_property_add_child (obj,"sdmc" ,OBJECT (&s->sdmc),NULL ); +object_property_add_child (obj,"sdmc" ,OBJECT (&s->sdmc),IGNORE_ERRORS );qdev_set_parent_bus (DEVICE (&s->sdmc),sysbus_get_default ());qdev_prop_set_uint32 (DEVICE (&s->sdmc),"silicon-rev" , sc->info->silicon_rev);
@@ -176,11 +178,12 @@ static void aspeed_soc_init(Object *obj) "ram-size", &error_abort);object_initialize (&s->wdt,sizeof (s->wdt),TYPE_ASPEED_WDT ); -object_property_add_child (obj,"wdt" ,OBJECT (&s->wdt),NULL ); +object_property_add_child (obj,"wdt" ,OBJECT (&s->wdt),IGNORE_ERRORS );qdev_set_parent_bus (DEVICE (&s->wdt),sysbus_get_default ());object_initialize (&s->ftgmac100,sizeof (s->ftgmac100),TYPE_FTGMAC100 ); -object_property_add_child (obj,"ftgmac100" ,OBJECT (&s->ftgmac100),NULL ); +object_property_add_child (obj,"ftgmac100" ,OBJECT (&s->ftgmac100), +IGNORE_ERRORS );qdev_set_parent_bus (DEVICE (&s->ftgmac100),sysbus_get_default ()); }
hw/arm/bcm2835_peripherals.c +17 -13
@@ -27,12 +27,14 @@ static void bcm2835_peripherals_init(Object *obj)/* Memory region for peripheral devices, which we export to our parent */ memory_region_init (&s->peri_mr, obj,"bcm2835-peripherals" ,0x1000000 ); -object_property_add_child (obj,"peripheral-io" ,OBJECT (&s->peri_mr),NULL ); +object_property_add_child (obj,"peripheral-io" ,OBJECT (&s->peri_mr), +IGNORE_ERRORS );sysbus_init_mmio (SYS_BUS_DEVICE (s), &s->peri_mr);/* Internal memory region for peripheral bus addresses (not exported) */ memory_region_init (&s->gpu_bus_mr, obj,"bcm2835-gpu" , (uint64_t )1 <<32 ); -object_property_add_child (obj,"gpu-bus" ,OBJECT (&s->gpu_bus_mr),NULL ); +object_property_add_child (obj,"gpu-bus" ,OBJECT (&s->gpu_bus_mr), +IGNORE_ERRORS );/* Internal memory region for request/response communication with * mailbox-addressable peripherals (not exported)
@@ -42,22 +44,22 @@ static void bcm2835_peripherals_init(Object *obj)/* Interrupt Controller */ object_initialize (&s->ic,sizeof (s->ic),TYPE_BCM2835_IC ); -object_property_add_child (obj,"ic" ,OBJECT (&s->ic),NULL ); +object_property_add_child (obj,"ic" ,OBJECT (&s->ic),IGNORE_ERRORS );qdev_set_parent_bus (DEVICE (&s->ic),sysbus_get_default ());/* UART0 */ s->uart0 =SYS_BUS_DEVICE (object_new ("pl011" )); -object_property_add_child (obj,"uart0" ,OBJECT (s->uart0),NULL ); +object_property_add_child (obj,"uart0" ,OBJECT (s->uart0),IGNORE_ERRORS );qdev_set_parent_bus (DEVICE (s->uart0),sysbus_get_default ());/* AUX / UART1 */ object_initialize (&s->aux,sizeof (s->aux),TYPE_BCM2835_AUX ); -object_property_add_child (obj,"aux" ,OBJECT (&s->aux),NULL ); +object_property_add_child (obj,"aux" ,OBJECT (&s->aux),IGNORE_ERRORS );qdev_set_parent_bus (DEVICE (&s->aux),sysbus_get_default ());/* Mailboxes */ object_initialize (&s->mboxes,sizeof (s->mboxes),TYPE_BCM2835_MBOX ); -object_property_add_child (obj,"mbox" ,OBJECT (&s->mboxes),NULL ); +object_property_add_child (obj,"mbox" ,OBJECT (&s->mboxes),IGNORE_ERRORS );qdev_set_parent_bus (DEVICE (&s->mboxes),sysbus_get_default ()); object_property_add_const_link(OBJECT(&s->mboxes), "mbox-mr",
@@ -65,7 +67,7 @@ static void bcm2835_peripherals_init(Object *obj)/* Framebuffer */ object_initialize (&s->fb,sizeof (s->fb),TYPE_BCM2835_FB ); -object_property_add_child (obj,"fb" ,OBJECT (&s->fb),NULL ); +object_property_add_child (obj,"fb" ,OBJECT (&s->fb),IGNORE_ERRORS );object_property_add_alias (obj,"vcram-size" ,OBJECT (&s->fb),"vcram-size" , &error_abort);qdev_set_parent_bus (DEVICE (&s->fb),sysbus_get_default ());
@@ -75,7 +77,8 @@ static void bcm2835_peripherals_init(Object *obj)/* Property channel */ object_initialize (&s->property,sizeof (s->property),TYPE_BCM2835_PROPERTY ); -object_property_add_child (obj,"property" ,OBJECT (&s->property),NULL ); +object_property_add_child (obj,"property" ,OBJECT (&s->property), +IGNORE_ERRORS );object_property_add_alias (obj,"board-rev" ,OBJECT (&s->property),"board-rev" , &error_abort);qdev_set_parent_bus (DEVICE (&s->property),sysbus_get_default ());
@@ -87,22 +90,23 @@ static void bcm2835_peripherals_init(Object *obj)/* Random Number Generator */ object_initialize (&s->rng,sizeof (s->rng),TYPE_BCM2835_RNG ); -object_property_add_child (obj,"rng" ,OBJECT (&s->rng),NULL ); +object_property_add_child (obj,"rng" ,OBJECT (&s->rng),IGNORE_ERRORS );qdev_set_parent_bus (DEVICE (&s->rng),sysbus_get_default ());/* Extended Mass Media Controller */ object_initialize (&s->sdhci,sizeof (s->sdhci),TYPE_SYSBUS_SDHCI ); -object_property_add_child (obj,"sdhci" ,OBJECT (&s->sdhci),NULL ); +object_property_add_child (obj,"sdhci" ,OBJECT (&s->sdhci),IGNORE_ERRORS );qdev_set_parent_bus (DEVICE (&s->sdhci),sysbus_get_default ());/* SDHOST */ object_initialize (&s->sdhost,sizeof (s->sdhost),TYPE_BCM2835_SDHOST ); -object_property_add_child (obj,"sdhost" ,OBJECT (&s->sdhost),NULL ); +object_property_add_child (obj,"sdhost" ,OBJECT (&s->sdhost), +IGNORE_ERRORS );qdev_set_parent_bus (DEVICE (&s->sdhost),sysbus_get_default ());/* DMA Channels */ object_initialize (&s->dma,sizeof (s->dma),TYPE_BCM2835_DMA ); -object_property_add_child (obj,"dma" ,OBJECT (&s->dma),NULL ); +object_property_add_child (obj,"dma" ,OBJECT (&s->dma),IGNORE_ERRORS );qdev_set_parent_bus (DEVICE (&s->dma),sysbus_get_default ()); object_property_add_const_link(OBJECT(&s->dma), "dma-mr",
@@ -110,7 +114,7 @@ static void bcm2835_peripherals_init(Object *obj)/* GPIO */ object_initialize (&s->gpio,sizeof (s->gpio),TYPE_BCM2835_GPIO ); -object_property_add_child (obj,"gpio" ,OBJECT (&s->gpio),NULL ); +object_property_add_child (obj,"gpio" ,OBJECT (&s->gpio),IGNORE_ERRORS );qdev_set_parent_bus (DEVICE (&s->gpio),sysbus_get_default ()); object_property_add_const_link(OBJECT(&s->gpio), "sdbus-sdhci",
hw/arm/bcm2836.c +2 -1
@@ -36,7 +36,8 @@ static void bcm2836_init(Object *obj) }object_initialize (&s->control,sizeof (s->control),TYPE_BCM2836_CONTROL ); -object_property_add_child (obj,"control" ,OBJECT (&s->control),NULL ); +object_property_add_child (obj,"control" ,OBJECT (&s->control), +IGNORE_ERRORS );qdev_set_parent_bus (DEVICE (&s->control),sysbus_get_default ()); object_initialize(&s->peripherals, sizeof(s->peripherals),
hw/arm/digic.c +4 -3
@@ -36,7 +36,7 @@ static void digic_init(Object *obj)int i;object_initialize (&s->cpu,sizeof (s->cpu),"arm946-" TYPE_ARM_CPU ); -object_property_add_child (obj,"cpu" ,OBJECT (&s->cpu),NULL ); +object_property_add_child (obj,"cpu" ,OBJECT (&s->cpu),IGNORE_ERRORS );for (i =0 ; i <DIGIC4_NB_TIMERS ; i++) {#define DIGIC_TIMER_NAME_MLEN 11
@@ -46,13 +46,14 @@ static void digic_init(Object *obj) dev =DEVICE (&s->timer[i]);qdev_set_parent_bus (dev,sysbus_get_default ());snprintf (name,DIGIC_TIMER_NAME_MLEN ,"timer[%d]" , i); -object_property_add_child (obj, name,OBJECT (&s->timer[i]),NULL ); +object_property_add_child (obj, name,OBJECT (&s->timer[i]), +IGNORE_ERRORS ); }object_initialize (&s->uart,sizeof (s->uart),TYPE_DIGIC_UART ); dev =DEVICE (&s->uart);qdev_set_parent_bus (dev,sysbus_get_default ()); -object_property_add_child (obj,"uart" ,OBJECT (&s->uart),NULL ); +object_property_add_child (obj,"uart" ,OBJECT (&s->uart),IGNORE_ERRORS ); }static void digic_realize (DeviceState *dev,Error **errp)
hw/arm/exynos4210.c +1 -1
@@ -180,7 +180,7 @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem,/* By default A9 CPUs have EL3 enabled. This board does not currently * support EL3 so the CPU EL3 property is disabled before realization. */ -if (object_property_find (cpuobj,"has_el3" ,NULL )) { +if (object_property_find (cpuobj,"has_el3" ,IGNORE_ERRORS )) {object_property_set_bool (cpuobj, false,"has_el3" , &error_fatal); }
hw/arm/fsl-imx6.c +20 -12
@@ -45,70 +45,78 @@ static void fsl_imx6_init(Object *obj)object_initialize (&s->cpu[i],sizeof (s->cpu[i]),"cortex-a9-" TYPE_ARM_CPU );snprintf (name,NAME_SIZE ,"cpu%d" , i); -object_property_add_child (obj, name,OBJECT (&s->cpu[i]),NULL ); +object_property_add_child (obj, name,OBJECT (&s->cpu[i]), +IGNORE_ERRORS ); }object_initialize (&s->a9mpcore,sizeof (s->a9mpcore),TYPE_A9MPCORE_PRIV );qdev_set_parent_bus (DEVICE (&s->a9mpcore),sysbus_get_default ()); -object_property_add_child (obj,"a9mpcore" ,OBJECT (&s->a9mpcore),NULL ); +object_property_add_child (obj,"a9mpcore" ,OBJECT (&s->a9mpcore), +IGNORE_ERRORS );object_initialize (&s->ccm,sizeof (s->ccm),TYPE_IMX6_CCM );qdev_set_parent_bus (DEVICE (&s->ccm),sysbus_get_default ()); -object_property_add_child (obj,"ccm" ,OBJECT (&s->ccm),NULL ); +object_property_add_child (obj,"ccm" ,OBJECT (&s->ccm),IGNORE_ERRORS );object_initialize (&s->src,sizeof (s->src),TYPE_IMX6_SRC );qdev_set_parent_bus (DEVICE (&s->src),sysbus_get_default ()); -object_property_add_child (obj,"src" ,OBJECT (&s->src),NULL ); +object_property_add_child (obj,"src" ,OBJECT (&s->src),IGNORE_ERRORS );for (i =0 ; i <FSL_IMX6_NUM_UARTS ; i++) {object_initialize (&s->uart[i],sizeof (s->uart[i]),TYPE_IMX_SERIAL );qdev_set_parent_bus (DEVICE (&s->uart[i]),sysbus_get_default ());snprintf (name,NAME_SIZE ,"uart%d" , i +1 ); -object_property_add_child (obj, name,OBJECT (&s->uart[i]),NULL ); +object_property_add_child (obj, name,OBJECT (&s->uart[i]), +IGNORE_ERRORS ); }object_initialize (&s->gpt,sizeof (s->gpt),TYPE_IMX6_GPT );qdev_set_parent_bus (DEVICE (&s->gpt),sysbus_get_default ()); -object_property_add_child (obj,"gpt" ,OBJECT (&s->gpt),NULL ); +object_property_add_child (obj,"gpt" ,OBJECT (&s->gpt),IGNORE_ERRORS );for (i =0 ; i <FSL_IMX6_NUM_EPITS ; i++) {object_initialize (&s->epit[i],sizeof (s->epit[i]),TYPE_IMX_EPIT );qdev_set_parent_bus (DEVICE (&s->epit[i]),sysbus_get_default ());snprintf (name,NAME_SIZE ,"epit%d" , i +1 ); -object_property_add_child (obj, name,OBJECT (&s->epit[i]),NULL ); +object_property_add_child (obj, name,OBJECT (&s->epit[i]), +IGNORE_ERRORS ); }for (i =0 ; i <FSL_IMX6_NUM_I2CS ; i++) {object_initialize (&s->i2c[i],sizeof (s->i2c[i]),TYPE_IMX_I2C );qdev_set_parent_bus (DEVICE (&s->i2c[i]),sysbus_get_default ());snprintf (name,NAME_SIZE ,"i2c%d" , i +1 ); -object_property_add_child (obj, name,OBJECT (&s->i2c[i]),NULL ); +object_property_add_child (obj, name,OBJECT (&s->i2c[i]), +IGNORE_ERRORS ); }for (i =0 ; i <FSL_IMX6_NUM_GPIOS ; i++) {object_initialize (&s->gpio[i],sizeof (s->gpio[i]),TYPE_IMX_GPIO );qdev_set_parent_bus (DEVICE (&s->gpio[i]),sysbus_get_default ());snprintf (name,NAME_SIZE ,"gpio%d" , i +1 ); -object_property_add_child (obj, name,OBJECT (&s->gpio[i]),NULL ); +object_property_add_child (obj, name,OBJECT (&s->gpio[i]), +IGNORE_ERRORS ); }for (i =0 ; i <FSL_IMX6_NUM_ESDHCS ; i++) {object_initialize (&s->esdhc[i],sizeof (s->esdhc[i]),TYPE_SYSBUS_SDHCI );qdev_set_parent_bus (DEVICE (&s->esdhc[i]),sysbus_get_default ());snprintf (name,NAME_SIZE ,"sdhc%d" , i +1 ); -object_property_add_child (obj, name,OBJECT (&s->esdhc[i]),NULL ); +object_property_add_child (obj, name,OBJECT (&s->esdhc[i]), +IGNORE_ERRORS ); }for (i =0 ; i <FSL_IMX6_NUM_ECSPIS ; i++) {object_initialize (&s->spi[i],sizeof (s->spi[i]),TYPE_IMX_SPI );qdev_set_parent_bus (DEVICE (&s->spi[i]),sysbus_get_default ());snprintf (name,NAME_SIZE ,"spi%d" , i +1 ); -object_property_add_child (obj, name,OBJECT (&s->spi[i]),NULL ); +object_property_add_child (obj, name,OBJECT (&s->spi[i]), +IGNORE_ERRORS ); }object_initialize (&s->eth,sizeof (s->eth),TYPE_IMX_ENET );qdev_set_parent_bus (DEVICE (&s->eth),sysbus_get_default ()); -object_property_add_child (obj,"eth" ,OBJECT (&s->eth),NULL ); +object_property_add_child (obj,"eth" ,OBJECT (&s->eth),IGNORE_ERRORS ); }static void fsl_imx6_realize (DeviceState *dev,Error **errp)
hw/arm/highbank.c +1 -1
@@ -260,7 +260,7 @@ static void calxeda_init(MachineState *machine, enum cxmachines machine_id) "start-powered-off", &error_abort); } -if (object_property_find (cpuobj,"reset-cbar" ,NULL )) { +if (object_property_find (cpuobj,"reset-cbar" ,IGNORE_ERRORS )) {object_property_set_int (cpuobj,MPCORE_PERIPHBASE ,"reset-cbar" , &error_abort); }
hw/arm/integratorcp.c +1 -1
@@ -618,7 +618,7 @@ static void integratorcp_init(MachineState *machine)* currently support EL3 so the CPU EL3 property is disabled before * realization. */ -if (object_property_find (cpuobj,"has_el3" ,NULL )) { +if (object_property_find (cpuobj,"has_el3" ,IGNORE_ERRORS )) {object_property_set_bool (cpuobj, false,"has_el3" , &error_fatal); }
hw/arm/realview.c +1 -1
@@ -109,7 +109,7 @@ static void realview_init(MachineState *machine,* does not currently support EL3 so the CPU EL3 property is disabled * before realization. */ -if (object_property_find (cpuobj,"has_el3" ,NULL )) { +if (object_property_find (cpuobj,"has_el3" ,IGNORE_ERRORS )) {object_property_set_bool (cpuobj, false,"has_el3" , &error_fatal); }
hw/arm/versatilepb.c +1 -1
@@ -223,7 +223,7 @@ static void versatile_init(MachineState *machine, int board_id)* currently support EL3 so the CPU EL3 property is disabled before * realization. */ -if (object_property_find (cpuobj,"has_el3" ,NULL )) { +if (object_property_find (cpuobj,"has_el3" ,IGNORE_ERRORS )) {object_property_set_bool (cpuobj, false,"has_el3" , &error_fatal); }
hw/arm/vexpress.c +4 -4
@@ -218,10 +218,10 @@ static void init_cpus(const char *cpu_model, const char *privdev,Object *cpuobj =object_new (object_class_get_name (cpu_oc));if (!secure) { -object_property_set_bool (cpuobj, false,"has_el3" ,NULL ); +object_property_set_bool (cpuobj, false,"has_el3" ,IGNORE_ERRORS ); } -if (object_property_find (cpuobj,"reset-cbar" ,NULL )) { +if (object_property_find (cpuobj,"reset-cbar" ,IGNORE_ERRORS )) {object_property_set_int (cpuobj, periphbase,"reset-cbar" , &error_abort); }
@@ -739,11 +739,11 @@ static void vexpress_instance_init(Object *obj)/* EL3 is enabled by default on vexpress */ vms->secure = true;object_property_add_bool (obj,"secure" , vexpress_get_secure, - vexpress_set_secure,NULL ); + vexpress_set_secure,IGNORE_ERRORS );object_property_set_description (obj,"secure" ,"Set on/off to enable/disable the ARM " "Security Extensions (TrustZone)" , -NULL ); +IGNORE_ERRORS ); }static void vexpress_class_init (ObjectClass *oc,void *data)
hw/arm/virt.c +21 -20
112 lines not on this page · raw message
hw/arm/xilinx_zynq.c +1 -1
@@ -183,7 +183,7 @@ static void zynq_init(MachineState *machine)* currently support EL3 so the CPU EL3 property is disabled before * realization. */ -if (object_property_find (OBJECT (cpu),"has_el3" ,NULL )) { +if (object_property_find (OBJECT (cpu),"has_el3" ,IGNORE_ERRORS )) {object_property_set_bool (OBJECT (cpu), false,"has_el3" , &error_fatal); }
hw/arm/xlnx-zynqmp.c +2 -2
@@ -259,9 +259,9 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)g_free (name);object_property_set_bool (OBJECT (&s->apu_cpu[i]), - s->secure,"has_el3" ,NULL ); + s->secure,"has_el3" ,IGNORE_ERRORS );object_property_set_bool (OBJECT (&s->apu_cpu[i]), - false,"has_el2" ,NULL ); + false,"has_el2" ,IGNORE_ERRORS );object_property_set_int (OBJECT (&s->apu_cpu[i]),GIC_BASE_ADDR ,"reset-cbar" , &error_abort); object_property_set_bool(OBJECT(&s->apu_cpu[i]), true, "realized",
hw/block/fdc.c +2 -2
@@ -2835,10 +2835,10 @@ static void isabus_fdc_instance_init(Object *obj)device_add_bootindex_property (obj, &isa->bootindexA,"bootindexA" ,"/floppy@0" , -DEVICE (obj),NULL ); +DEVICE (obj),IGNORE_ERRORS );device_add_bootindex_property (obj, &isa->bootindexB,"bootindexB" ,"/floppy@1" , -DEVICE (obj),NULL ); +DEVICE (obj),IGNORE_ERRORS ); }static const TypeInfo isa_fdc_info = {
hw/block/nvme.c +1 -1
@@ -943,7 +943,7 @@ static int nvme_init(PCIDevice *pci_dev)pci_register_bar (&n->parent_obj,0 ,PCI_BASE_ADDRESS_SPACE_MEMORY |PCI_BASE_ADDRESS_MEM_TYPE_64 , &n->iomem); -msix_init_exclusive_bar (&n->parent_obj, n->num_queues,4 ,NULL ); +msix_init_exclusive_bar (&n->parent_obj, n->num_queues,4 ,IGNORE_ERRORS ); id->vid =cpu_to_le16 (pci_get_word (pci_conf +PCI_VENDOR_ID )); id->ssvid =cpu_to_le16 (pci_get_word (pci_conf +PCI_SUBSYSTEM_VENDOR_ID ));
hw/block/virtio-blk.c +2 -2
@@ -984,10 +984,10 @@ static void virtio_blk_instance_init(Object *obj)object_property_add_link (obj,"iothread" ,TYPE_IOTHREAD , (Object **)&s->conf.iothread, qdev_prop_allow_set_link_before_realize, -OBJ_PROP_LINK_UNREF_ON_RELEASE ,NULL ); +OBJ_PROP_LINK_UNREF_ON_RELEASE ,IGNORE_ERRORS );device_add_bootindex_property (obj, &s->conf.conf.bootindex,"bootindex" ,"/disk@0,0" , -DEVICE (obj),NULL ); +DEVICE (obj),IGNORE_ERRORS ); }static const VMStateDescription vmstate_virtio_blk = {
hw/core/bus.c +5 -3
@@ -101,7 +101,8 @@ static void qbus_realize(BusState *bus, DeviceState *parent, const char *name)if (bus->parent) {QLIST_INSERT_HEAD (&bus->parent->child_bus, bus, sibling); bus->parent->num_child_bus++; -object_property_add_child (OBJECT (bus->parent), bus->name,OBJECT (bus),NULL ); +object_property_add_child (OBJECT (bus->parent), bus->name,OBJECT (bus), +IGNORE_ERRORS );object_unref (OBJECT (bus)); }else if (bus !=sysbus_get_default ()) {/* TODO: once all bus devices are qdevified,
@@ -198,9 +199,10 @@ static void qbus_initfn(Object *obj) (Object **)&bus->hotplug_handler, object_property_allow_set_link,0 , - NULL); + IGNORE_ERRORS);object_property_add_bool (obj,"realized" , - bus_get_realized, bus_set_realized,NULL ); + bus_get_realized, bus_set_realized, +IGNORE_ERRORS ); }static char *default_bus_get_fw_dev_path (DeviceState *dev)
hw/core/platform-bus.c +3 -2
@@ -64,7 +64,8 @@ hwaddr platform_bus_get_mmio_addr(PlatformBusDevice *pbus, SysBusDevice *sbdev,return -1 ; } - parent_mr =object_property_get_link (OBJECT (sbdev_mr),"container" ,NULL ); + parent_mr =object_property_get_link (OBJECT (sbdev_mr),"container" , +IGNORE_ERRORS );assert (parent_mr);if (parent_mr != pbus_mr_obj) {
@@ -72,7 +73,7 @@ hwaddr platform_bus_get_mmio_addr(PlatformBusDevice *pbus, SysBusDevice *sbdev,return -1 ; } -return object_property_get_int (OBJECT (sbdev_mr),"addr" ,NULL ); +return object_property_get_int (OBJECT (sbdev_mr),"addr" ,IGNORE_ERRORS ); }static void platform_bus_count_irqs (SysBusDevice *sbdev,void *opaque)
hw/core/qdev-properties-system.c +2 -2
@@ -77,7 +77,7 @@ static void parse_drive(DeviceState *dev, const char *str, void **ptr, blk =blk_by_name (str);if (!blk) { -BlockDriverState *bs =bdrv_lookup_bs (NULL , str,NULL ); +BlockDriverState *bs =bdrv_lookup_bs (NULL , str,IGNORE_ERRORS );if (bs) { blk =blk_new (0 ,BLK_PERM_ALL ); blk_created = true;
@@ -442,7 +442,7 @@ void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd)qdev_prop_set_netdev (dev,"netdev" , nd->netdev); }if (nd->nvectors !=DEV_NVECTORS_UNSPECIFIED && -object_property_find (OBJECT (dev),"vectors" ,NULL )) { +object_property_find (OBJECT (dev),"vectors" ,IGNORE_ERRORS )) {qdev_prop_set_uint32 (dev,"vectors" , nd->nvectors); } nd->instantiated =1 ;
hw/core/qdev.c +13 -11
@@ -71,7 +71,7 @@ static void bus_remove_child(BusState *bus, DeviceState *child)QTAILQ_REMOVE (&bus->children, kid, sibling);/* This gives back ownership of kid->child back to us. */ -object_property_del (OBJECT (bus), name,NULL ); +object_property_del (OBJECT (bus), name,IGNORE_ERRORS );object_unref (OBJECT (kid->child));g_free (kid);return ;
@@ -97,7 +97,7 @@ static void bus_add_child(BusState *bus, DeviceState *child) (Object **)&kid->child,NULL ,/* read-only property */ 0 ,/* return ownership on prop deletion */ - NULL); + IGNORE_ERRORS); }void qdev_set_parent_bus (DeviceState *dev,BusState *bus)
@@ -470,7 +470,8 @@ void qdev_connect_gpio_out_named(DeviceState *dev, const char *name, int n,*/ object_property_add_child (container_get (qdev_get_machine (),"/unattached" ), -"non-qdev-gpio[*]" ,OBJECT (pin),NULL ); +"non-qdev-gpio[*]" ,OBJECT (pin), +IGNORE_ERRORS ); }object_property_set_link (OBJECT (dev),OBJECT (pin), propname, &error_abort);g_free (propname);
@@ -482,7 +483,7 @@ qemu_irq qdev_get_gpio_out_connector(DeviceState *dev, const char *name, int n) name ? name : "unnamed-gpio-out", n);qemu_irq ret = (qemu_irq )object_property_get_link (OBJECT (dev), propname, -NULL ); +IGNORE_ERRORS );return ret; }
@@ -496,9 +497,9 @@ static qemu_irq qdev_disconnect_gpio_out_named(DeviceState *dev, name ? name : "unnamed-gpio-out", n);qemu_irq ret = (qemu_irq )object_property_get_link (OBJECT (dev), propname, -NULL ); +IGNORE_ERRORS );if (ret) { -object_property_set_link (OBJECT (dev),NULL , propname,NULL ); +object_property_set_link (OBJECT (dev),NULL , propname,IGNORE_ERRORS ); }g_free (propname);return ret;
@@ -838,7 +839,7 @@ static int qdev_add_hotpluggable_device(Object *obj, void *opaque)return 0 ; } -if (dev->realized &&object_property_get_bool (obj,"hotpluggable" ,NULL )) { +if (dev->realized &&object_property_get_bool (obj,"hotpluggable" ,IGNORE_ERRORS )) { *list =g_slist_append (*list, dev); }
@@ -978,7 +979,7 @@ static void device_set_realized(Object *obj, bool value, Error **errp) child_realize_fail: QLIST_FOREACH(bus, &dev->child_bus, sibling) {object_property_set_bool (OBJECT (bus), false,"realized" , -NULL ); +IGNORE_ERRORS ); }if (qdev_get_vmsd (dev)) {
@@ -1029,9 +1030,10 @@ static void device_initfn(Object *obj) dev->realized = false;object_property_add_bool (obj,"realized" , - device_get_realized, device_set_realized,NULL ); + device_get_realized, device_set_realized, +IGNORE_ERRORS );object_property_add_bool (obj,"hotpluggable" , - device_get_hotpluggable,NULL ,NULL ); + device_get_hotpluggable,NULL ,IGNORE_ERRORS );object_property_add_bool (obj,"hotplugged" , device_get_hotplugged,NULL , &error_abort);
@@ -1090,7 +1092,7 @@ static void device_unparent(Object *obj)BusState *bus;if (dev->realized) { -object_property_set_bool (obj, false,"realized" ,NULL ); +object_property_set_bool (obj, false,"realized" ,IGNORE_ERRORS ); }while (dev->num_child_bus) { bus =QLIST_FIRST (&dev->child_bus);
hw/core/sysbus.c +3 -2
@@ -92,7 +92,7 @@ bool sysbus_has_irq(SysBusDevice *dev, int n)char *prop =g_strdup_printf ("%s[%d]" ,SYSBUS_DEVICE_GPIO_IRQ , n);ObjectProperty *r; - r =object_property_find (OBJECT (dev), prop,NULL ); + r =object_property_find (OBJECT (dev), prop,IGNORE_ERRORS );g_free (prop);return (r !=NULL );
@@ -362,7 +362,8 @@ static void main_system_bus_create(void)OBJECT (main_system_bus)->free = g_free;object_property_add_child (container_get (qdev_get_machine (),"/unattached" ), -"sysbus" ,OBJECT (main_system_bus),NULL ); +"sysbus" ,OBJECT (main_system_bus), +IGNORE_ERRORS ); }BusState *sysbus_get_default (void )
hw/cpu/a15mpcore.c +1 -1
@@ -66,7 +66,7 @@ static void a15mp_priv_realize(DeviceState *dev, Error **errp)* either all the CPUs have TZ, or none do. */ cpuobj =OBJECT (qemu_get_cpu (0 )); - has_el3 =object_property_find (cpuobj,"has_el3" ,NULL ) && + has_el3 =object_property_find (cpuobj,"has_el3" ,IGNORE_ERRORS ) &&object_property_get_bool (cpuobj,"has_el3" , &error_abort);qdev_prop_set_bit (gicdev,"has-security-extensions" , has_el3); }
hw/cpu/a9mpcore.c +1 -1
@@ -72,7 +72,7 @@ static void a9mp_priv_realize(DeviceState *dev, Error **errp)* either all the CPUs have TZ, or none do. */ cpuobj =OBJECT (qemu_get_cpu (0 )); - has_el3 =object_property_find (cpuobj,"has_el3" ,NULL ) && + has_el3 =object_property_find (cpuobj,"has_el3" ,IGNORE_ERRORS ) &&object_property_get_bool (cpuobj,"has_el3" , &error_abort);qdev_prop_set_bit (gicdev,"has-security-extensions" , has_el3);
hw/cpu/core.c +2 -2
@@ -66,9 +66,9 @@ static void cpu_core_instance_init(Object *obj)CPUCore *core =CPU_CORE (obj);object_property_add (obj,"core-id" ,"int" , core_prop_get_core_id, - core_prop_set_core_id,NULL ,NULL ,NULL ); + core_prop_set_core_id,NULL ,NULL ,IGNORE_ERRORS );object_property_add (obj,"nr-threads" ,"int" , core_prop_get_nr_threads, - core_prop_set_nr_threads,NULL ,NULL ,NULL ); + core_prop_set_nr_threads,NULL ,NULL ,IGNORE_ERRORS ); core->nr_threads = smp_threads; }
hw/display/vga-pci.c +4 -2
@@ -268,7 +268,8 @@ static void pci_std_vga_init(Object *obj) {/* Expose framebuffer byteorder via QOM */ object_property_add_bool (obj,"big-endian-framebuffer" , - vga_get_big_endian_fb, vga_set_big_endian_fb,NULL ); + vga_get_big_endian_fb, vga_set_big_endian_fb, +IGNORE_ERRORS ); }static void pci_secondary_vga_realize (PCIDevice *dev,Error **errp)
@@ -298,7 +299,8 @@ static void pci_secondary_vga_init(Object *obj) {/* Expose framebuffer byteorder via QOM */ object_property_add_bool (obj,"big-endian-framebuffer" , - vga_get_big_endian_fb, vga_set_big_endian_fb,NULL ); + vga_get_big_endian_fb, vga_set_big_endian_fb, +IGNORE_ERRORS ); }static void pci_secondary_vga_reset (DeviceState *dev)
hw/i386/acpi-build.c +30 -21
135 lines not on this page · raw message
hw/i386/kvm/pci-assign.c +1 -1
@@ -1843,7 +1843,7 @@ static void assigned_dev_instance_init(Object *obj)device_add_bootindex_property (obj, &d->bootindex,"bootindex" ,NULL , - &pci_dev->qdev,NULL ); + &pci_dev->qdev,IGNORE_ERRORS ); }static Property assigned_dev_properties[] = {
hw/i386/pc.c +2 -2
@@ -1560,7 +1560,7 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,* IRQ8 and IRQ2. */ uint8_t compat =object_property_get_int (OBJECT (hpet), -HPET_INTCAP ,NULL ); +HPET_INTCAP ,IGNORE_ERRORS );if (!compat) {qdev_prop_set_uint32 (hpet,HPET_INTCAP , hpet_irqs); }
@@ -1671,7 +1671,7 @@ void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name) }if (parent_name) {object_property_add_child (object_resolve_path (parent_name,NULL ), -"ioapic" ,OBJECT (dev),NULL ); +"ioapic" ,OBJECT (dev),IGNORE_ERRORS ); }qdev_init_nofail (dev); d =SYS_BUS_DEVICE (dev);
hw/i386/pc_q35.c +8 -7
@@ -162,19 +162,20 @@ static void pc_q35_init(MachineState *machine)/* create pci host bus */ q35_host =Q35_HOST_DEVICE (qdev_create (NULL ,TYPE_Q35_HOST_DEVICE )); -object_property_add_child (qdev_get_machine (),"q35" ,OBJECT (q35_host),NULL ); +object_property_add_child (qdev_get_machine (),"q35" ,OBJECT (q35_host), +IGNORE_ERRORS );object_property_set_link (OBJECT (q35_host),OBJECT (ram_memory), -MCH_HOST_PROP_RAM_MEM ,NULL ); +MCH_HOST_PROP_RAM_MEM ,IGNORE_ERRORS );object_property_set_link (OBJECT (q35_host),OBJECT (pci_memory), -MCH_HOST_PROP_PCI_MEM ,NULL ); +MCH_HOST_PROP_PCI_MEM ,IGNORE_ERRORS );object_property_set_link (OBJECT (q35_host),OBJECT (get_system_memory ()), -MCH_HOST_PROP_SYSTEM_MEM ,NULL ); +MCH_HOST_PROP_SYSTEM_MEM ,IGNORE_ERRORS );object_property_set_link (OBJECT (q35_host),OBJECT (system_io), -MCH_HOST_PROP_IO_MEM ,NULL ); +MCH_HOST_PROP_IO_MEM ,IGNORE_ERRORS );object_property_set_int (OBJECT (q35_host), pcms->below_4g_mem_size, -PCI_HOST_BELOW_4G_MEM_SIZE ,NULL ); +PCI_HOST_BELOW_4G_MEM_SIZE ,IGNORE_ERRORS );object_property_set_int (OBJECT (q35_host), pcms->above_4g_mem_size, -PCI_HOST_ABOVE_4G_MEM_SIZE ,NULL ); +PCI_HOST_ABOVE_4G_MEM_SIZE ,IGNORE_ERRORS );/* pci */ qdev_init_nofail (DEVICE (q35_host)); phb =PCI_HOST_BRIDGE (q35_host);
hw/ide/ich.c +1 -1
@@ -147,7 +147,7 @@ static void pci_ich9_ahci_realize(PCIDevice *dev, Error **errp)/* Although the AHCI 1.3 specification states that the first capability * should be PMCAP, the Intel ICH9 data sheet specifies that the ICH9 * AHCI device puts the MSI capability first, pointing to 0x80. */ - ret =msi_init (dev,ICH9_MSI_CAP_OFFSET ,1 , true, false,NULL ); + ret =msi_init (dev,ICH9_MSI_CAP_OFFSET ,1 , true, false,IGNORE_ERRORS );/* Any error other than -ENOTSUP(board's MSI support is broken) * is a programming error. Fall back to INTx silently on -ENOTSUP */ assert (!ret || ret == -ENOTSUP );
hw/ide/qdev.c +2 -2
@@ -263,8 +263,8 @@ static void ide_dev_instance_init(Object *obj) {object_property_add (obj,"bootindex" ,"int32" , ide_dev_get_bootindex, - ide_dev_set_bootindex,NULL ,NULL ,NULL ); -object_property_set_int (obj,-1 ,"bootindex" ,NULL ); + ide_dev_set_bootindex,NULL ,NULL ,IGNORE_ERRORS ); +object_property_set_int (obj,-1 ,"bootindex" ,IGNORE_ERRORS ); }static int ide_hd_initfn (IDEDevice *dev)
hw/input/virtio-input-hid.c +2 -1
@@ -267,7 +267,8 @@ static void virtio_input_hid_realize(DeviceState *dev, Error **errp) vhid->hs =qemu_input_handler_register (dev, vhid->handler);if (vhid->display && vhid->hs) { -qemu_input_handler_bind (vhid->hs, vhid->display, vhid->head,NULL ); +qemu_input_handler_bind (vhid->hs, vhid->display, vhid->head, +IGNORE_ERRORS ); } }
hw/intc/apic_common.c +2 -2
@@ -331,7 +331,7 @@ static void apic_common_realize(DeviceState *dev, Error **errp) instance_id =-1 ; }vmstate_register_with_alias_id (NULL , instance_id, &vmstate_apic_common, - s,-1 ,0 ,NULL ); + s,-1 ,0 ,IGNORE_ERRORS ); }static void apic_common_unrealize (DeviceState *dev,Error **errp)
@@ -486,7 +486,7 @@ static void apic_common_initfn(Object *obj) s->id = s->initial_apic_id =-1 ;object_property_add (obj,"id" ,"int" , apic_common_get_id, - apic_common_set_id,NULL ,NULL ,NULL ); + apic_common_set_id,NULL ,NULL ,IGNORE_ERRORS ); }static void apic_common_class_init (ObjectClass *klass,void *data)
hw/intc/arm_gicv3_common.c +2 -1
@@ -267,7 +267,8 @@ static void arm_gicv3_common_realize(DeviceState *dev, Error **errp)* VLPIS == 0 (virtual LPIs not supported) * PLPIS == 0 (physical LPIs not supported) */ - cpu_affid =object_property_get_int (OBJECT (cpu),"mp-affinity" ,NULL ); + cpu_affid =object_property_get_int (OBJECT (cpu),"mp-affinity" , +IGNORE_ERRORS ); last = (i == s->num_cpu -1 );/* The CPU mp-affinity property is in MPIDR register format; squash
hw/intc/s390_flic.c +1 -1
@@ -40,7 +40,7 @@ void s390_flic_init(void)if (!dev) { dev =qdev_create (NULL ,TYPE_QEMU_S390_FLIC );object_property_add_child (qdev_get_machine (),TYPE_QEMU_S390_FLIC , -OBJECT (dev),NULL ); +OBJECT (dev),IGNORE_ERRORS ); }qdev_init_nofail (dev); }
hw/intc/s390_flic_kvm.c +1 -1
@@ -40,7 +40,7 @@ DeviceState *s390_flic_kvm_create(void)if (kvm_enabled ()) { dev =qdev_create (NULL ,TYPE_KVM_S390_FLIC );object_property_add_child (qdev_get_machine (),TYPE_KVM_S390_FLIC , -OBJECT (dev),NULL ); +OBJECT (dev),IGNORE_ERRORS ); }return dev; }
hw/ipmi/ipmi.c +1 -1
@@ -59,7 +59,7 @@ static int ipmi_do_hw_op(IPMIInterface *s, enum ipmi_op op, int checkonly)if (checkonly) {return 0 ; } -qmp_inject_nmi (NULL ); +qmp_inject_nmi (IGNORE_ERRORS );return 0 ;case IPMI_SHUTDOWN_VIA_ACPI_OVERTEMP :
hw/isa/lpc_ich9.c +3 -3
@@ -653,11 +653,11 @@ static void ich9_lpc_add_properties(ICH9LPCState *lpc)object_property_add (OBJECT (lpc),ACPI_PM_PROP_SCI_INT ,"uint32" , ich9_lpc_get_sci_int, -NULL ,NULL ,NULL ,NULL ); +NULL ,NULL ,NULL ,IGNORE_ERRORS );object_property_add_uint8_ptr (OBJECT (lpc),ACPI_PM_PROP_ACPI_ENABLE_CMD , - &acpi_enable_cmd,NULL ); + &acpi_enable_cmd,IGNORE_ERRORS );object_property_add_uint8_ptr (OBJECT (lpc),ACPI_PM_PROP_ACPI_DISABLE_CMD , - &acpi_disable_cmd,NULL ); + &acpi_disable_cmd,IGNORE_ERRORS );ich9_pm_add_properties (OBJECT (lpc), &lpc->pm,NULL ); }
hw/mem/nvdimm.c +1 -1
@@ -68,7 +68,7 @@ static void nvdimm_init(Object *obj) {object_property_add (obj,"label-size" ,"int" , nvdimm_get_label_size, nvdimm_set_label_size,NULL , -NULL ,NULL ); +NULL ,IGNORE_ERRORS ); }static MemoryRegion *nvdimm_get_memory_region (PCDIMMDevice *dimm)
hw/mem/pc-dimm.c +1 -1
@@ -182,7 +182,7 @@ int qmp_pc_dimm_device_list(Object *obj, void *opaque) di->slot = dimm->slot; di->node = dimm->node; di->size =object_property_get_int (OBJECT (dimm),PC_DIMM_SIZE_PROP , -NULL ); +IGNORE_ERRORS ); di->memdev =object_get_canonical_path (OBJECT (dimm->hostmem)); info->u.dimm.data = di;
hw/microblaze/petalogix_ml605_mmu.c +8 -6
@@ -145,14 +145,15 @@ petalogix_ml605_init(MachineState *machine)/* FIXME: attach to the sysbus instead */ object_property_add_child (qdev_get_machine (),"xilinx-eth" ,OBJECT (eth0), -NULL ); +IGNORE_ERRORS );object_property_add_child (qdev_get_machine (),"xilinx-dma" ,OBJECT (dma), -NULL ); +IGNORE_ERRORS ); ds =object_property_get_link (OBJECT (dma), -"axistream-connected-target" ,NULL ); +"axistream-connected-target" ,IGNORE_ERRORS ); cs =object_property_get_link (OBJECT (dma), -"axistream-control-connected-target" ,NULL ); +"axistream-control-connected-target" , +IGNORE_ERRORS );qdev_set_nic_properties (eth0, &nd_table[0 ]);qdev_prop_set_uint32 (eth0,"rxmem" ,0x1000 );qdev_prop_set_uint32 (eth0,"txmem" ,0x1000 );
@@ -165,9 +166,10 @@ petalogix_ml605_init(MachineState *machine)sysbus_connect_irq (SYS_BUS_DEVICE (eth0),0 , irq[AXIENET_IRQ ]); ds =object_property_get_link (OBJECT (eth0), -"axistream-connected-target" ,NULL ); +"axistream-connected-target" ,IGNORE_ERRORS ); cs =object_property_get_link (OBJECT (eth0), -"axistream-control-connected-target" ,NULL ); +"axistream-control-connected-target" , +IGNORE_ERRORS );qdev_prop_set_uint32 (dma,"freqhz" ,100 *1000000 );object_property_set_link (OBJECT (dma),OBJECT (ds),"axistream-connected" , &error_abort);
hw/mips/boston.c +1 -1
@@ -531,7 +531,7 @@ static void boston_mach_init(MachineState *machine)memory_region_add_subregion_overlap (sys_mem,0x17fff000 , lcd,0 ); chr =qemu_chr_new ("lcd" ,"vc:320x240" ); -qemu_chr_fe_init (&s->lcd_display, chr,NULL ); +qemu_chr_fe_init (&s->lcd_display, chr,IGNORE_ERRORS );qemu_chr_fe_set_handlers (&s->lcd_display,NULL ,NULL , boston_lcd_event, s,NULL , true);
hw/mips/mips_malta.c +1 -1
@@ -569,7 +569,7 @@ static MaltaFPGAState *malta_fpga_init(MemoryRegion *address_space,memory_region_add_subregion (address_space, base +0xa00 , &s->iomem_hi); chr =qemu_chr_new ("fpga" ,"vc:320x200" ); -qemu_chr_fe_init (&s->display, chr,NULL ); +qemu_chr_fe_init (&s->display, chr,IGNORE_ERRORS );qemu_chr_fe_set_handlers (&s->display,NULL ,NULL , malta_fgpa_display_event, s,NULL , true);
hw/misc/auxbus.c +1 -1
@@ -245,7 +245,7 @@ static void aux_slave_dev_print(Monitor *mon, DeviceState *dev, int indent)monitor_printf (mon,"%*smemory " TARGET_FMT_plx"/" TARGET_FMT_plx"\n" , indent,"" , -object_property_get_int (OBJECT (s->mmio),"addr" ,NULL ), +object_property_get_int (OBJECT (s->mmio),"addr" ,IGNORE_ERRORS ),memory_region_size (s->mmio)); }
hw/misc/edu.c +1 -1
@@ -392,7 +392,7 @@ static void edu_instance_init(Object *obj) edu->dma_mask = (1UL <<28 ) -1 ;object_property_add (obj,"dma_mask" ,"uint64" , edu_obj_uint64, - edu_obj_uint64,NULL , &edu->dma_mask,NULL ); + edu_obj_uint64,NULL , &edu->dma_mask,IGNORE_ERRORS ); }static void edu_class_init (ObjectClass *class,void *data)
hw/misc/macio/macio.c +2 -2
@@ -214,7 +214,7 @@ static void macio_init_ide(MacIOState *s, MACIOIDEState *ide, size_t ide_size,memory_region_add_subregion (&s->bar,0x1f000 + ((index +1 ) *0x1000 ), &ide->mem); name =g_strdup_printf ("ide[%i]" , index); -object_property_add_child (OBJECT (s), name,OBJECT (ide),NULL ); +object_property_add_child (OBJECT (s), name,OBJECT (ide),IGNORE_ERRORS );g_free (name); }
@@ -333,7 +333,7 @@ static void macio_instance_init(Object *obj)object_initialize (&s->cuda,sizeof (s->cuda),TYPE_CUDA );qdev_set_parent_bus (DEVICE (&s->cuda),sysbus_get_default ()); -object_property_add_child (obj,"cuda" ,OBJECT (&s->cuda),NULL ); +object_property_add_child (obj,"cuda" ,OBJECT (&s->cuda),IGNORE_ERRORS ); }static const VMStateDescription vmstate_macio_oldworld = {
hw/misc/pvpanic.c +1 -1
@@ -112,7 +112,7 @@ uint16_t pvpanic_port(void)if (!o) {return 0 ; } -return object_property_get_int (o,PVPANIC_IOPORT_PROP ,NULL ); +return object_property_get_int (o,PVPANIC_IOPORT_PROP ,IGNORE_ERRORS ); }static Property pvpanic_isa_properties[] = {
hw/misc/tmp105.c +1 -1
@@ -244,7 +244,7 @@ static void tmp105_initfn(Object *obj) {object_property_add (obj,"temperature" ,"int" , tmp105_get_temperature, - tmp105_set_temperature,NULL ,NULL ,NULL ); + tmp105_set_temperature,NULL ,NULL ,IGNORE_ERRORS ); }static void tmp105_class_init (ObjectClass *klass,void *data)
hw/net/e1000.c +1 -1
@@ -1676,7 +1676,7 @@ static void e1000_instance_init(Object *obj)E1000State *n =E1000 (obj);device_add_bootindex_property (obj, &n->conf.bootindex,"bootindex" ,"/ethernet-phy@0" , -DEVICE (n),NULL ); +DEVICE (n),IGNORE_ERRORS ); }static const TypeInfo e1000_base_info = {
hw/net/e1000e.c +4 -4
@@ -293,7 +293,7 @@ e1000e_init_msix(E1000EState *s)E1000E_MSIX_IDX ,E1000E_MSIX_TABLE , &s->msix,E1000E_MSIX_IDX ,E1000E_MSIX_PBA , - 0xA0, NULL); + 0xA0, IGNORE_ERRORS);if (res <0 ) {trace_e1000e_msix_init_fail (res);
@@ -463,7 +463,7 @@ static void e1000e_pci_realize(PCIDevice *pci_dev, Error **errp)hw_error ("Failed to initialize PCIe capability" ); } - ret =msi_init (PCI_DEVICE (s),0xD0 ,1 , true, false,NULL ); + ret =msi_init (PCI_DEVICE (s),0xD0 ,1 , true, false,IGNORE_ERRORS );if (ret) {trace_e1000e_msi_init_fail (ret); }
@@ -474,7 +474,7 @@ static void e1000e_pci_realize(PCIDevice *pci_dev, Error **errp) }if (pcie_aer_init (pci_dev,PCI_ERR_VER , e1000e_aer_offset, -PCI_ERR_SIZEOF ,NULL ) <0 ) { +PCI_ERR_SIZEOF ,IGNORE_ERRORS ) <0 ) {hw_error ("Failed to initialize AER capability" ); }
@@ -694,7 +694,7 @@ static void e1000e_instance_init(Object *obj)E1000EState *s =E1000E (obj);device_add_bootindex_property (obj, &s->conf.bootindex,"bootindex" ,"/ethernet-phy@0" , -DEVICE (obj),NULL ); +DEVICE (obj),IGNORE_ERRORS ); }static const TypeInfo e1000e_info = {
hw/net/eepro100.c +1 -1
@@ -1906,7 +1906,7 @@ static void eepro100_instance_init(Object *obj)EEPRO100State *s =DO_UPCAST (EEPRO100State, dev,PCI_DEVICE (obj));device_add_bootindex_property (obj, &s->conf.bootindex,"bootindex" ,"/ethernet-phy@0" , -DEVICE (s),NULL ); +DEVICE (s),IGNORE_ERRORS ); }static E100PCIDeviceInfo e100_devices[] = {
hw/net/lance.c +1 -1
@@ -145,7 +145,7 @@ static void lance_instance_init(Object *obj)device_add_bootindex_property (obj, &s->conf.bootindex,"bootindex" ,"/ethernet-phy@0" , -DEVICE (obj),NULL ); +DEVICE (obj),IGNORE_ERRORS ); }static Property lance_properties[] = {
hw/net/ne2000-isa.c +2 -2
@@ -134,8 +134,8 @@ static void isa_ne2000_instance_init(Object *obj) {object_property_add (obj,"bootindex" ,"int32" , isa_ne2000_get_bootindex, - isa_ne2000_set_bootindex,NULL ,NULL ,NULL ); -object_property_set_int (obj,-1 ,"bootindex" ,NULL ); + isa_ne2000_set_bootindex,NULL ,NULL ,IGNORE_ERRORS ); +object_property_set_int (obj,-1 ,"bootindex" ,IGNORE_ERRORS ); }static const TypeInfo ne2000_isa_info = { .name =TYPE_ISA_NE2000 ,
hw/net/ne2000.c +1 -1
@@ -757,7 +757,7 @@ static void ne2000_instance_init(Object *obj)device_add_bootindex_property (obj, &s->c.bootindex,"bootindex" ,"/ethernet-phy@0" , - &pci_dev->qdev,NULL ); + &pci_dev->qdev,IGNORE_ERRORS ); }static Property ne2000_properties[] = {
hw/net/pcnet-pci.c +1 -1
@@ -334,7 +334,7 @@ static void pcnet_instance_init(Object *obj)device_add_bootindex_property (obj, &s->conf.bootindex,"bootindex" ,"/ethernet-phy@0" , -DEVICE (obj),NULL ); +DEVICE (obj),IGNORE_ERRORS ); }static Property pcnet_properties[] = {
hw/net/rtl8139.c +1 -1
@@ -3458,7 +3458,7 @@ static void rtl8139_instance_init(Object *obj)device_add_bootindex_property (obj, &s->conf.bootindex,"bootindex" ,"/ethernet-phy@0" , -DEVICE (obj),NULL ); +DEVICE (obj),IGNORE_ERRORS ); }static Property rtl8139_properties[] = {
hw/net/spapr_llan.c +1 -1
@@ -340,7 +340,7 @@ static void spapr_vlan_instance_init(Object *obj)device_add_bootindex_property (obj, &dev->nicconf.bootindex,"bootindex" ,"" , -DEVICE (dev),NULL ); +DEVICE (dev),IGNORE_ERRORS );if (dev->compat_flags &SPAPRVLAN_FLAG_RX_BUF_POOLS ) {for (i =0 ; i <RX_MAX_POOLS ; i++) {
hw/net/virtio-net.c +1 -1
@@ -2036,7 +2036,7 @@ static void virtio_net_instance_init(Object *obj) n->config_size =sizeof (struct virtio_net_config );device_add_bootindex_property (obj, &n->nic_conf.bootindex,"bootindex" ,"/ethernet-phy@0" , -DEVICE (n),NULL ); +DEVICE (n),IGNORE_ERRORS ); }static void virtio_net_pre_save (void *opaque)
hw/net/vmxnet3.c +3 -3
@@ -2192,7 +2192,7 @@ vmxnet3_init_msix(VMXNET3State *s)VMXNET3_MSIX_BAR_IDX ,VMXNET3_OFF_MSIX_TABLE , &s->msix_bar,VMXNET3_MSIX_BAR_IDX ,VMXNET3_OFF_MSIX_PBA (s), - VMXNET3_MSIX_OFFSET(s), NULL); + VMXNET3_MSIX_OFFSET(s), IGNORE_ERRORS);if (0 > res) {VMW_WRPRN ("Failed to initialize MSI-X, error %d" , res);
@@ -2317,7 +2317,7 @@ static void vmxnet3_pci_realize(PCIDevice *pci_dev, Error **errp) pci_dev->config[PCI_INTERRUPT_PIN ] =0x01 ; ret =msi_init (pci_dev,VMXNET3_MSI_OFFSET (s),VMXNET3_MAX_NMSIX_INTRS , -VMXNET3_USE_64BIT ,VMXNET3_PER_VECTOR_MASK ,NULL ); +VMXNET3_USE_64BIT ,VMXNET3_PER_VECTOR_MASK ,IGNORE_ERRORS );/* Any error other than -ENOTSUP(board's MSI support is broken) * is a programming error. Fall back to INTx silently on -ENOTSUP */ assert (!ret || ret == -ENOTSUP );
@@ -2345,7 +2345,7 @@ static void vmxnet3_instance_init(Object *obj)VMXNET3State *s =VMXNET3 (obj);device_add_bootindex_property (obj, &s->conf.bootindex,"bootindex" ,"/ethernet-phy@0" , -DEVICE (obj),NULL ); +DEVICE (obj),IGNORE_ERRORS ); }static void vmxnet3_pci_uninit (PCIDevice *pci_dev)
hw/nvram/fw_cfg.c +2 -1
@@ -917,7 +917,8 @@ static void fw_cfg_init1(DeviceState *dev)assert (!object_resolve_path (FW_CFG_PATH ,NULL )); -object_property_add_child (OBJECT (machine),FW_CFG_NAME ,OBJECT (s),NULL ); +object_property_add_child (OBJECT (machine),FW_CFG_NAME ,OBJECT (s), +IGNORE_ERRORS );qdev_init_nofail (dev);
hw/pci-host/gpex.c +1 -1
@@ -94,7 +94,7 @@ static void gpex_host_initfn(Object *obj)GPEXRootState *root = &s->gpex_root;object_initialize (root,sizeof (*root),TYPE_GPEX_ROOT_DEVICE ); -object_property_add_child (obj,"gpex_root" ,OBJECT (root),NULL ); +object_property_add_child (obj,"gpex_root" ,OBJECT (root),IGNORE_ERRORS );qdev_prop_set_uint32 (DEVICE (root),"addr" ,PCI_DEVFN (0 ,0 ));qdev_prop_set_bit (DEVICE (root),"multifunction" , false); }
hw/pci-host/piix.c +7 -6
@@ -275,19 +275,19 @@ static void i440fx_pcihost_initfn(Object *obj)object_property_add (obj,PCI_HOST_PROP_PCI_HOLE_START ,"int" , i440fx_pcihost_get_pci_hole_start, -NULL ,NULL ,NULL ,NULL ); +NULL ,NULL ,NULL ,IGNORE_ERRORS );object_property_add (obj,PCI_HOST_PROP_PCI_HOLE_END ,"int" , i440fx_pcihost_get_pci_hole_end, -NULL ,NULL ,NULL ,NULL ); +NULL ,NULL ,NULL ,IGNORE_ERRORS );object_property_add (obj,PCI_HOST_PROP_PCI_HOLE64_START ,"int" , i440fx_pcihost_get_pci_hole64_start, -NULL ,NULL ,NULL ,NULL ); +NULL ,NULL ,NULL ,IGNORE_ERRORS );object_property_add (obj,PCI_HOST_PROP_PCI_HOLE64_END ,"int" , i440fx_pcihost_get_pci_hole64_end, -NULL ,NULL ,NULL ,NULL ); +NULL ,NULL ,NULL ,IGNORE_ERRORS ); }static void i440fx_pcihost_realize (DeviceState *dev,Error **errp)
@@ -306,7 +306,7 @@ static void i440fx_realize(PCIDevice *dev, Error **errp) { dev->config[I440FX_SMRAM ] =0x02 ; -if (object_property_get_bool (qdev_get_machine (),"iommu" ,NULL )) { +if (object_property_get_bool (qdev_get_machine (),"iommu" ,IGNORE_ERRORS )) {error_report ("warning: i440fx doesn't support emulated iommu" ); } }
@@ -337,7 +337,8 @@ PCIBus *i440fx_init(const char *host_type, const char *pci_type, b =pci_bus_new (dev,NULL , pci_address_space, address_space_io,0 ,TYPE_PCI_BUS ); s->bus = b; -object_property_add_child (qdev_get_machine (),"i440fx" ,OBJECT (dev),NULL ); +object_property_add_child (qdev_get_machine (),"i440fx" ,OBJECT (dev), +IGNORE_ERRORS );qdev_init_nofail (dev); d =pci_create_simple (b,0 , pci_type);
hw/pci-host/prep.c +1 -1
@@ -290,7 +290,7 @@ static void raven_pcihost_initfn(Object *obj) pci_dev =DEVICE (&s->pci_dev);qdev_set_parent_bus (pci_dev,BUS (&s->pci_bus));object_property_set_int (OBJECT (&s->pci_dev),PCI_DEVFN (0 ,0 ),"addr" , -NULL ); +IGNORE_ERRORS );qdev_prop_set_bit (pci_dev,"multifunction" , false); }
hw/pci-host/q35.c +15 -10
@@ -172,45 +172,50 @@ static void q35_host_initfn(Object *obj) "pci-conf-data", 4);object_initialize (&s->mch,sizeof (s->mch),TYPE_MCH_PCI_DEVICE ); -object_property_add_child (OBJECT (s),"mch" ,OBJECT (&s->mch),NULL ); +object_property_add_child (OBJECT (s),"mch" ,OBJECT (&s->mch), +IGNORE_ERRORS );qdev_prop_set_uint32 (DEVICE (&s->mch),"addr" ,PCI_DEVFN (0 ,0 ));qdev_prop_set_bit (DEVICE (&s->mch),"multifunction" , false);object_property_add (obj,PCI_HOST_PROP_PCI_HOLE_START ,"int" , q35_host_get_pci_hole_start, -NULL ,NULL ,NULL ,NULL ); +NULL ,NULL ,NULL ,IGNORE_ERRORS );object_property_add (obj,PCI_HOST_PROP_PCI_HOLE_END ,"int" , q35_host_get_pci_hole_end, -NULL ,NULL ,NULL ,NULL ); +NULL ,NULL ,NULL ,IGNORE_ERRORS );object_property_add (obj,PCI_HOST_PROP_PCI_HOLE64_START ,"int" , q35_host_get_pci_hole64_start, -NULL ,NULL ,NULL ,NULL ); +NULL ,NULL ,NULL ,IGNORE_ERRORS );object_property_add (obj,PCI_HOST_PROP_PCI_HOLE64_END ,"int" , q35_host_get_pci_hole64_end, -NULL ,NULL ,NULL ,NULL ); +NULL ,NULL ,NULL ,IGNORE_ERRORS );object_property_add (obj,PCIE_HOST_MCFG_SIZE ,"int" , q35_host_get_mmcfg_size, -NULL ,NULL ,NULL ,NULL ); +NULL ,NULL ,NULL ,IGNORE_ERRORS );object_property_add_link (obj,MCH_HOST_PROP_RAM_MEM ,TYPE_MEMORY_REGION , (Object **) &s->mch.ram_memory, - qdev_prop_allow_set_link_before_realize,0 ,NULL ); + qdev_prop_allow_set_link_before_realize,0 , +IGNORE_ERRORS );object_property_add_link (obj,MCH_HOST_PROP_PCI_MEM ,TYPE_MEMORY_REGION , (Object **) &s->mch.pci_address_space, - qdev_prop_allow_set_link_before_realize,0 ,NULL ); + qdev_prop_allow_set_link_before_realize,0 , +IGNORE_ERRORS );object_property_add_link (obj,MCH_HOST_PROP_SYSTEM_MEM ,TYPE_MEMORY_REGION , (Object **) &s->mch.system_memory, - qdev_prop_allow_set_link_before_realize,0 ,NULL ); + qdev_prop_allow_set_link_before_realize,0 , +IGNORE_ERRORS );object_property_add_link (obj,MCH_HOST_PROP_IO_MEM ,TYPE_MEMORY_REGION , (Object **) &s->mch.address_space_io, - qdev_prop_allow_set_link_before_realize,0 ,NULL ); + qdev_prop_allow_set_link_before_realize,0 , +IGNORE_ERRORS );/* Leave enough space for the biggest MCFG BAR */ /* TODO: this matches current bios behaviour, but
hw/pci-host/xilinx-pcie.c +2 -2
@@ -121,7 +121,7 @@ static void xilinx_pcie_host_realize(DeviceState *dev, Error **errp)memory_region_set_enabled (&s->mmio, false);/* dummy I/O region */ -memory_region_init_ram (&s->io,OBJECT (s),"io" ,16 ,NULL ); +memory_region_init_ram (&s->io,OBJECT (s),"io" ,16 ,IGNORE_ERRORS );memory_region_set_enabled (&s->io, false);/* interrupt out */
@@ -150,7 +150,7 @@ static void xilinx_pcie_host_init(Object *obj)XilinxPCIERoot *root = &s->root;object_initialize (root,sizeof (*root),TYPE_XILINX_PCIE_ROOT ); -object_property_add_child (obj,"root" ,OBJECT (root),NULL ); +object_property_add_child (obj,"root" ,OBJECT (root),IGNORE_ERRORS );qdev_prop_set_uint32 (DEVICE (root),"addr" ,PCI_DEVFN (0 ,0 ));qdev_prop_set_bit (DEVICE (root),"multifunction" , false); }
hw/pci/pci.c +1 -1
@@ -2018,7 +2018,7 @@ static void pci_qdev_realize(DeviceState *qdev, Error **errp)pci_add_option_rom (pci_dev, is_default_rom, &local_err);if (local_err) {error_propagate (errp, local_err); -pci_qdev_unrealize (DEVICE (pci_dev),NULL ); +pci_qdev_unrealize (DEVICE (pci_dev),IGNORE_ERRORS );return ; } }
hw/pci/pcie.c +1 -1
@@ -427,7 +427,7 @@ void pcie_cap_slot_init(PCIDevice *dev, uint16_t slot) dev->exp.hpev_notified = false;qbus_set_hotplug_handler (BUS (pci_bridge_get_sec_bus (PCI_BRIDGE (dev))), -DEVICE (dev),NULL ); +DEVICE (dev),IGNORE_ERRORS ); }void pcie_cap_slot_reset (PCIDevice *dev)
hw/pci/shpc.c +1 -1
@@ -646,7 +646,7 @@ int shpc_init(PCIDevice *d, PCIBus *sec_bus, MemoryRegion *bar, unsigned offset)shpc_cap_update_dword (d);memory_region_add_subregion (bar, offset, &shpc->mmio); -qbus_set_hotplug_handler (BUS (sec_bus),DEVICE (d),NULL ); +qbus_set_hotplug_handler (BUS (sec_bus),DEVICE (d),IGNORE_ERRORS ); d->cap_present |=QEMU_PCI_CAP_SHPC ;return 0 ;
hw/pcmcia/pxa2xx.c +1 -1
@@ -189,7 +189,7 @@ static void pxa2xx_pcmcia_initfn(Object *obj)object_property_add_link (obj,"card" ,TYPE_PCMCIA_CARD , (Object **)&s->card,NULL ,/* read-only property */ -0 ,NULL ); +0 ,IGNORE_ERRORS ); }/* Insert a new card into a slot */
hw/ppc/e500.c +1 -1
@@ -872,7 +872,7 @@ void ppce500_init(MachineState *machine, PPCE500Params *params) dev =qdev_create (NULL ,"e500-ccsr" );object_property_add_child (qdev_get_machine (),"e500-ccsr" , -OBJECT (dev),NULL ); +OBJECT (dev),IGNORE_ERRORS );qdev_init_nofail (dev); ccsr =CCSR (dev); ccsr_addr_space = &ccsr->ccsr_space;
hw/ppc/pnv.c +5 -5
@@ -833,15 +833,15 @@ static void pnv_chip_init(Object *obj) chip->xscom_base = pcc->xscom_base;object_initialize (&chip->lpc,sizeof (chip->lpc),TYPE_PNV_LPC ); -object_property_add_child (obj,"lpc" ,OBJECT (&chip->lpc),NULL ); +object_property_add_child (obj,"lpc" ,OBJECT (&chip->lpc),IGNORE_ERRORS );object_initialize (&chip->psi,sizeof (chip->psi),TYPE_PNV_PSI ); -object_property_add_child (obj,"psi" ,OBJECT (&chip->psi),NULL ); +object_property_add_child (obj,"psi" ,OBJECT (&chip->psi),IGNORE_ERRORS );object_property_add_const_link (OBJECT (&chip->psi),"xics" ,OBJECT (qdev_get_machine ()), &error_abort);object_initialize (&chip->occ,sizeof (chip->occ),TYPE_PNV_OCC ); -object_property_add_child (obj,"occ" ,OBJECT (&chip->occ),NULL ); +object_property_add_child (obj,"occ" ,OBJECT (&chip->occ),IGNORE_ERRORS );object_property_add_const_link (OBJECT (&chip->occ),"psi" ,OBJECT (&chip->psi), &error_abort);
@@ -1113,10 +1113,10 @@ static void powernv_machine_class_props_init(ObjectClass *oc) {object_class_property_add (oc,"num-chips" ,"uint32_t" , pnv_get_num_chips, pnv_set_num_chips, -NULL ,NULL ,NULL ); +NULL ,NULL ,IGNORE_ERRORS );object_class_property_set_description (oc,"num-chips" ,"Specifies the number of processor chips" , -NULL ); +IGNORE_ERRORS ); }static void powernv_machine_class_init (ObjectClass *oc,void *data)
hw/ppc/pnv_core.c +1 -1
@@ -119,7 +119,7 @@ static void pnv_core_realize_child(Object *child, XICSFabric *xi, Error **errp)Object *obj; obj =object_new (TYPE_PNV_ICP ); -object_property_add_child (OBJECT (cpu),"icp" , obj,NULL ); +object_property_add_child (OBJECT (cpu),"icp" , obj,IGNORE_ERRORS );object_property_add_const_link (obj,"xics" ,OBJECT (xi), &error_abort);object_property_set_bool (obj, true,"realized" , &local_err);if (local_err) {
hw/ppc/pnv_psi.c +2 -1
@@ -446,7 +446,8 @@ static void pnv_psi_init(Object *obj)PnvPsi *psi =PNV_PSI (obj);object_initialize (&psi->ics,sizeof (psi->ics),TYPE_ICS_SIMPLE ); -object_property_add_child (obj,"ics-psi" ,OBJECT (&psi->ics),NULL ); +object_property_add_child (obj,"ics-psi" ,OBJECT (&psi->ics), +IGNORE_ERRORS ); }static const uint8_t irq_to_xivr[] = {
hw/ppc/prep.c +4 -2
@@ -598,7 +598,8 @@ static void ppc_prep_init(MachineState *machine)qdev_prop_set_string (dev,"bios-name" , bios_name);qdev_prop_set_uint32 (dev,"elf-machine" ,PPC_ELF_MACHINE ); pcihost =PCI_HOST_BRIDGE (dev); -object_property_add_child (qdev_get_machine (),"raven" ,OBJECT (dev),NULL ); +object_property_add_child (qdev_get_machine (),"raven" ,OBJECT (dev), +IGNORE_ERRORS );qdev_init_nofail (dev); pci_bus = (PCIBus *)qdev_get_child_bus (dev,"pci.0" );if (pci_bus ==NULL ) {
@@ -755,7 +756,8 @@ static void ibm_40p_init(MachineState *machine)qdev_prop_set_string (dev,"bios-name" , bios_name);qdev_prop_set_uint32 (dev,"elf-machine" ,PPC_ELF_MACHINE ); pcihost =SYS_BUS_DEVICE (dev); -object_property_add_child (qdev_get_machine (),"raven" ,OBJECT (dev),NULL ); +object_property_add_child (qdev_get_machine (),"raven" ,OBJECT (dev), +IGNORE_ERRORS );qdev_init_nofail (dev); pci_bus =PCI_BUS (qdev_get_child_bus (dev,"pci.0" ));if (!pci_bus) {
hw/ppc/spapr.c +8 -6
@@ -659,7 +659,7 @@ static int spapr_populate_drconf_memory(sPAPRMachineState *spapr, void *fdt) dynamic_memory[1 ] =cpu_to_be32 (addr &0xffffffff ); dynamic_memory[2 ] =cpu_to_be32 (spapr_drc_index (drc)); dynamic_memory[3 ] =cpu_to_be32 (0 );/* reserved */ - dynamic_memory[4 ] =cpu_to_be32 (numa_get_node (addr,NULL )); + dynamic_memory[4 ] =cpu_to_be32 (numa_get_node (addr,IGNORE_ERRORS ));if (memory_region_present (get_system_memory (), addr)) { dynamic_memory[5 ] =cpu_to_be32 (SPAPR_LMB_FLAGS_ASSIGNED ); }else {
@@ -2481,19 +2481,20 @@ static void spapr_machine_initfn(Object *obj) spapr->htab_fd =-1 ; spapr->use_hotplug_event_source = true;object_property_add_str (obj,"kvm-type" , - spapr_get_kvm_type, spapr_set_kvm_type,NULL ); + spapr_get_kvm_type, spapr_set_kvm_type, +IGNORE_ERRORS );object_property_set_description (obj,"kvm-type" ,"Specifies the KVM virtualization mode (HV, PR)" , -NULL ); +IGNORE_ERRORS );object_property_add_bool (obj,"modern-hotplug-events" , spapr_get_modern_hotplug_events, spapr_set_modern_hotplug_events, -NULL ); +IGNORE_ERRORS );object_property_set_description (obj,"modern-hotplug-events" ,"Use dedicated hotplug event mechanism in" " place of standard EPOW events when possible" " (required for memory hot-unplug support)" , -NULL ); +IGNORE_ERRORS ); }static void spapr_machine_finalizefn (Object *obj)
@@ -2611,7 +2612,8 @@ static void spapr_memory_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,return ; } - mem_dev =object_property_get_str (OBJECT (dimm),PC_DIMM_MEMDEV_PROP ,NULL ); + mem_dev =object_property_get_str (OBJECT (dimm),PC_DIMM_MEMDEV_PROP , +IGNORE_ERRORS );if (mem_dev && !kvmppc_is_mem_backend_page_size_ok (mem_dev)) {error_setg (errp,"Memory backend has bad page size. " "Use 'memory-backend-file' with correct mem-path." );
hw/ppc/spapr_drc.c +10 -9
@@ -360,7 +360,7 @@ static void attach(sPAPRDRConnector *drc, DeviceState *d, void *fdt,object_property_add_link (OBJECT (drc),"device" ,object_get_typename (OBJECT (drc->dev)), (Object **)(&drc->dev), -NULL ,0 ,NULL ); +NULL ,0 ,IGNORE_ERRORS ); }static void detach (sPAPRDRConnector *drc,DeviceState *d,Error **errp)
@@ -432,7 +432,7 @@ static void detach(sPAPRDRConnector *drc, DeviceState *d, Error **errp)g_free (drc->fdt); drc->fdt =NULL ; drc->fdt_start_offset =0 ; -object_property_del (OBJECT (drc),"device" ,NULL ); +object_property_del (OBJECT (drc),"device" ,IGNORE_ERRORS ); drc->dev =NULL ; }
@@ -592,8 +592,8 @@ sPAPRDRConnector *spapr_dr_connector_new(Object *owner, const char *type, drc->owner = owner; prop_name =g_strdup_printf ("dr-connector[%" PRIu32"]" ,spapr_drc_index (drc)); -object_property_add_child (owner, prop_name,OBJECT (drc),NULL ); -object_property_set_bool (OBJECT (drc), true,"realized" ,NULL ); +object_property_add_child (owner, prop_name,OBJECT (drc),IGNORE_ERRORS ); +object_property_set_bool (OBJECT (drc), true,"realized" ,IGNORE_ERRORS );g_free (prop_name);/* human-readable name for a DRC to encode into the DT
@@ -647,12 +647,12 @@ static void spapr_dr_connector_instance_init(Object *obj) {sPAPRDRConnector *drc =SPAPR_DR_CONNECTOR (obj); -object_property_add_uint32_ptr (obj,"id" , &drc->id,NULL ); +object_property_add_uint32_ptr (obj,"id" , &drc->id,IGNORE_ERRORS );object_property_add (obj,"index" ,"uint32" , prop_get_index, -NULL ,NULL ,NULL ,NULL ); -object_property_add_str (obj,"name" , prop_get_name,NULL ,NULL ); +NULL ,NULL ,NULL ,IGNORE_ERRORS ); +object_property_add_str (obj,"name" , prop_get_name,NULL ,IGNORE_ERRORS );object_property_add (obj,"fdt" ,"struct" , prop_get_fdt, -NULL ,NULL ,NULL ,NULL ); +NULL ,NULL ,NULL ,IGNORE_ERRORS ); }static void spapr_dr_connector_class_init (ObjectClass *k,void *data)
@@ -823,7 +823,8 @@ int spapr_drc_populate_dt(void *fdt, int fdt_offset, Object *owner,continue ; } - obj =object_property_get_link (root_container, prop->name,NULL ); + obj =object_property_get_link (root_container, prop->name, +IGNORE_ERRORS ); drc =SPAPR_DR_CONNECTOR (obj); drck =SPAPR_DR_CONNECTOR_GET_CLASS (drc);
hw/ppc/spapr_iommu.c +2 -2
@@ -323,9 +323,9 @@ sPAPRTCETable *spapr_tce_new_table(DeviceState *owner, uint32_t liobn) tcet->liobn = liobn;snprintf (tmp,sizeof (tmp),"tce-table-%x" , liobn); -object_property_add_child (OBJECT (owner), tmp,OBJECT (tcet),NULL ); +object_property_add_child (OBJECT (owner), tmp,OBJECT (tcet),IGNORE_ERRORS ); -object_property_set_bool (OBJECT (tcet), true,"realized" ,NULL ); +object_property_set_bool (OBJECT (tcet), true,"realized" ,IGNORE_ERRORS );return tcet; }
hw/ppc/spapr_pci.c +2 -2
@@ -760,7 +760,7 @@ static char *spapr_phb_vfio_get_loc_code(sPAPRPHBState *sphb, PCIDevice *pdev)char *path =NULL , *buf =NULL , *host =NULL ;/* Get the PCI VFIO host id */ - host =object_property_get_str (OBJECT (pdev),"host" ,NULL ); + host =object_property_get_str (OBJECT (pdev),"host" ,IGNORE_ERRORS );if (!host) { goto err_out; }
@@ -1697,7 +1697,7 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp) &sphb->memspace, &sphb->iospace, PCI_DEVFN(0, 0), PCI_NUM_PINS, TYPE_PCI_BUS); phb->bus = bus; -qbus_set_hotplug_handler (BUS (phb->bus),DEVICE (sphb),NULL ); +qbus_set_hotplug_handler (BUS (phb->bus),DEVICE (sphb),IGNORE_ERRORS );/* * Initialize PHB address space.
hw/ppc/spapr_rng.c +2 -2
@@ -106,10 +106,10 @@ static void spapr_rng_instance_init(Object *obj)object_property_add_link (obj,"rng" ,TYPE_RNG_BACKEND , (Object **)&rngstate->backend, object_property_allow_set_link, -OBJ_PROP_LINK_UNREF_ON_RELEASE ,NULL ); +OBJ_PROP_LINK_UNREF_ON_RELEASE ,IGNORE_ERRORS );object_property_set_description (obj,"rng" ,"ID of the random number generator backend" , -NULL ); +IGNORE_ERRORS ); }static void spapr_rng_realize (DeviceState *dev,Error **errp)
hw/ppc/spapr_rtc.c +2 -1
@@ -146,7 +146,8 @@ static void spapr_rtc_realize(DeviceState *dev, Error **errp) rtc_ns =qemu_clock_get_ns (rtc_clock); rtc->ns_offset = host_s *NANOSECONDS_PER_SECOND - rtc_ns; -object_property_add_tm (OBJECT (rtc),"date" , spapr_rtc_qom_date,NULL ); +object_property_add_tm (OBJECT (rtc),"date" , spapr_rtc_qom_date, +IGNORE_ERRORS ); }static const VMStateDescription vmstate_spapr_rtc = {
hw/s390x/event-facility.c +2 -2
@@ -354,12 +354,12 @@ static void init_event_facility(Object *obj) TYPE_SCLP_EVENTS_BUS, sdev, NULL); new =object_new (TYPE_SCLP_QUIESCE ); -object_property_add_child (obj,TYPE_SCLP_QUIESCE , new,NULL ); +object_property_add_child (obj,TYPE_SCLP_QUIESCE , new,IGNORE_ERRORS );object_unref (new);qdev_set_parent_bus (DEVICE (new), &event_facility->sbus.qbus); new =object_new (TYPE_SCLP_CPU_HOTPLUG ); -object_property_add_child (obj,TYPE_SCLP_CPU_HOTPLUG , new,NULL ); +object_property_add_child (obj,TYPE_SCLP_CPU_HOTPLUG , new,IGNORE_ERRORS );object_unref (new);qdev_set_parent_bus (DEVICE (new), &event_facility->sbus.qbus);/* the facility will automatically realize the devices via the bus */
hw/s390x/ipl.c +2 -1
@@ -282,7 +282,8 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl)int s390_ipl_set_loadparm (uint8_t *loadparm) {MachineState *machine =MACHINE (qdev_get_machine ()); -char *lp =object_property_get_str (OBJECT (machine),"loadparm" ,NULL ); +char *lp =object_property_get_str (OBJECT (machine),"loadparm" , +IGNORE_ERRORS );if (lp) {int i;
hw/s390x/s390-pci-bus.c +4 -4
@@ -189,7 +189,7 @@ void s390_pci_sclp_deconfigure(SCCB *sccb) rc =SCLP_RC_NORMAL_COMPLETION ;if (pbdev->release_timer) { -qdev_unplug (DEVICE (pbdev->pdev),NULL ); +qdev_unplug (DEVICE (pbdev->pdev),IGNORE_ERRORS ); } } out:
@@ -569,11 +569,11 @@ static int s390_pcihost_init(SysBusDevice *dev)pci_setup_iommu (b, s390_pci_dma_iommu, s); bus =BUS (b); -qbus_set_hotplug_handler (bus,DEVICE (dev),NULL ); +qbus_set_hotplug_handler (bus,DEVICE (dev),IGNORE_ERRORS ); phb->bus = b; s->bus =S390_PCI_BUS (qbus_create (TYPE_S390_PCI_BUS ,DEVICE (s),NULL )); -qbus_set_hotplug_handler (BUS (s->bus),DEVICE (s),NULL ); +qbus_set_hotplug_handler (BUS (s->bus),DEVICE (s),IGNORE_ERRORS ); s->iommu_table =g_hash_table_new_full (g_int64_hash, g_int64_equal,NULL , g_free);
@@ -761,7 +761,7 @@ static void s390_pcihost_timer_cb(void *opaque) pbdev->state =ZPCI_FS_STANDBY ;s390_pci_generate_plug_event (HP_EVENT_CONFIGURED_TO_STBRES , pbdev->fh, pbdev->fid); -qdev_unplug (DEVICE (pbdev),NULL ); +qdev_unplug (DEVICE (pbdev),IGNORE_ERRORS ); } static void s390_pcihost_hot_unplug(HotplugHandler *hotplug_dev,
hw/s390x/s390-skeys.c +3 -3
@@ -41,7 +41,7 @@ void s390_skeys_init(void) obj =object_new (TYPE_QEMU_S390_SKEYS ); }object_property_add_child (qdev_get_machine (),TYPE_S390_SKEYS , - obj,NULL ); + obj,IGNORE_ERRORS );object_unref (obj);qdev_init_nofail (DEVICE (obj));
@@ -392,8 +392,8 @@ static void s390_skeys_instance_init(Object *obj) {object_property_add_bool (obj,"migration-enabled" , s390_skeys_get_migration_enabled, - s390_skeys_set_migration_enabled,NULL ); -object_property_set_bool (obj, true,"migration-enabled" ,NULL ); + s390_skeys_set_migration_enabled,IGNORE_ERRORS ); +object_property_set_bool (obj, true,"migration-enabled" ,IGNORE_ERRORS ); }static void s390_skeys_class_init (ObjectClass *oc,void *data)
hw/s390x/s390-virtio-ccw.c +12 -12
@@ -128,7 +128,7 @@ static void ccw_init(MachineState *machine) dev =qdev_create (NULL ,TYPE_S390_PCI_HOST_BRIDGE );object_property_add_child (qdev_get_machine (),TYPE_S390_PCI_HOST_BRIDGE , -OBJECT (dev),NULL ); +OBJECT (dev),IGNORE_ERRORS );qdev_init_nofail (dev);/* register hypercalls */
@@ -331,33 +331,33 @@ static inline void s390_machine_initfn(Object *obj) {object_property_add_bool (obj,"aes-key-wrap" , machine_get_aes_key_wrap, - machine_set_aes_key_wrap,NULL ); + machine_set_aes_key_wrap,IGNORE_ERRORS );object_property_set_description (obj,"aes-key-wrap" ,"enable/disable AES key wrapping using the CPACF wrapping key" , -NULL ); -object_property_set_bool (obj, true,"aes-key-wrap" ,NULL ); +IGNORE_ERRORS ); +object_property_set_bool (obj, true,"aes-key-wrap" ,IGNORE_ERRORS );object_property_add_bool (obj,"dea-key-wrap" , machine_get_dea_key_wrap, - machine_set_dea_key_wrap,NULL ); + machine_set_dea_key_wrap,IGNORE_ERRORS );object_property_set_description (obj,"dea-key-wrap" ,"enable/disable DEA key wrapping using the CPACF wrapping key" , -NULL ); -object_property_set_bool (obj, true,"dea-key-wrap" ,NULL ); +IGNORE_ERRORS ); +object_property_set_bool (obj, true,"dea-key-wrap" ,IGNORE_ERRORS );object_property_add_str (obj,"loadparm" , - machine_get_loadparm, machine_set_loadparm,NULL ); + machine_get_loadparm, machine_set_loadparm,IGNORE_ERRORS );object_property_set_description (obj,"loadparm" ,"Up to 8 chars in set of [A-Za-z0-9. ] (lower case chars converted" " to upper case) to pass to machine loader, boot manager," " and guest kernel" , -NULL ); +IGNORE_ERRORS );object_property_add_bool (obj,"s390-squash-mcss" , machine_get_squash_mcss, - machine_set_squash_mcss,NULL ); + machine_set_squash_mcss,IGNORE_ERRORS );object_property_set_description (obj,"s390-squash-mcss" ,"enable/disable squashing subchannels into the default css" , -NULL ); -object_property_set_bool (obj, false,"s390-squash-mcss" ,NULL ); +IGNORE_ERRORS ); +object_property_set_bool (obj, false,"s390-squash-mcss" ,IGNORE_ERRORS ); }static const TypeInfo ccw_machine_info = {
hw/s390x/s390-virtio.c +1 -1
@@ -82,7 +82,7 @@ void s390_init_ipl_dev(const char *kernel_filename,qdev_prop_set_string (dev,"netboot_fw" , netboot_fw);qdev_prop_set_bit (dev,"enforce_bios" , enforce_bios);object_property_add_child (qdev_get_machine (),TYPE_S390_IPL , - new,NULL ); + new,IGNORE_ERRORS );object_unref (new);qdev_init_nofail (dev); }
hw/s390x/sclp.c +4 -3
@@ -478,7 +478,7 @@ void s390_sclp_init(void)Object *new =object_new (TYPE_SCLP );object_property_add_child (qdev_get_machine (),TYPE_SCLP , new, -NULL ); +IGNORE_ERRORS );object_unref (OBJECT (new));qdev_init_nofail (DEVICE (new)); }
@@ -569,7 +569,8 @@ static void sclp_init(Object *obj)Object *new; new =object_new (TYPE_SCLP_EVENT_FACILITY ); -object_property_add_child (obj,TYPE_SCLP_EVENT_FACILITY , new,NULL ); +object_property_add_child (obj,TYPE_SCLP_EVENT_FACILITY , new, +IGNORE_ERRORS );object_unref (new); sclp->event_facility =EVENT_FACILITY (new);
@@ -612,7 +613,7 @@ sclpMemoryHotplugDev *init_sclp_memory_hotplug_dev(void) dev =qdev_create (NULL ,TYPE_SCLP_MEMORY_HOTPLUG_DEV );object_property_add_child (qdev_get_machine (),TYPE_SCLP_MEMORY_HOTPLUG_DEV , -OBJECT (dev),NULL ); +OBJECT (dev),IGNORE_ERRORS );qdev_init_nofail (dev);return SCLP_MEMORY_HOTPLUG_DEV (object_resolve_path (TYPE_SCLP_MEMORY_HOTPLUG_DEV ,NULL ));
hw/s390x/virtio-ccw.c +2 -2
@@ -912,7 +912,7 @@ static void virtio_ccw_rng_realize(VirtioCcwDevice *ccw_dev, Error **errp)object_property_set_link (OBJECT (dev),OBJECT (dev->vdev.conf.rng),"rng" , -NULL ); +IGNORE_ERRORS ); }static void virtio_ccw_crypto_realize (VirtioCcwDevice *ccw_dev,Error **errp)
@@ -930,7 +930,7 @@ static void virtio_ccw_crypto_realize(VirtioCcwDevice *ccw_dev, Error **errp)object_property_set_link (OBJECT (vdev),OBJECT (dev->vdev.conf.cryptodev),"cryptodev" , -NULL ); +IGNORE_ERRORS ); }/* DeviceState to VirtioCcwDevice. Note: used on datapath,
hw/scsi/megasas.c +1 -1
@@ -2366,7 +2366,7 @@ static void megasas_scsi_realize(PCIDevice *dev, Error **errp)if (megasas_use_msix (s) &&msix_init (dev,15 , &s->mmio_io, b->mmio_bar,0x2000 , - &s->mmio_io, b->mmio_bar,0x3800 ,0x68 ,NULL )) { + &s->mmio_io, b->mmio_bar,0x3800 ,0x68 ,IGNORE_ERRORS )) {/* TODO: check msix_init's error, and should fail on msix=on */ s->msix =ON_OFF_AUTO_OFF ; }
hw/scsi/scsi-bus.c +4 -4
@@ -234,7 +234,7 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk, driver =blk_is_sg (blk) ?"scsi-generic" :"scsi-disk" ; dev =qdev_create (&bus->qbus, driver); name =g_strdup_printf ("legacy[%d]" , unit); -object_property_add_child (OBJECT (bus), name,OBJECT (dev),NULL ); +object_property_add_child (OBJECT (bus), name,OBJECT (dev),IGNORE_ERRORS );g_free (name);qdev_prop_set_uint32 (dev,"scsi-id" , unit);
@@ -242,10 +242,10 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk,object_property_set_int (OBJECT (dev), bootindex,"bootindex" , &error_abort); } -if (object_property_find (OBJECT (dev),"removable" ,NULL )) { +if (object_property_find (OBJECT (dev),"removable" ,IGNORE_ERRORS )) {qdev_prop_set_bit (dev,"removable" , removable); } -if (serial &&object_property_find (OBJECT (dev),"serial" ,NULL )) { +if (serial &&object_property_find (OBJECT (dev),"serial" ,IGNORE_ERRORS )) {qdev_prop_set_string (dev,"serial" , serial); }qdev_prop_set_drive (dev,"drive" , blk, &err);
@@ -2127,7 +2127,7 @@ static void scsi_dev_instance_init(Object *obj)device_add_bootindex_property (obj, &s->conf.bootindex,"bootindex" ,NULL , - &s->qdev,NULL ); + &s->qdev,IGNORE_ERRORS ); }static const TypeInfo scsi_device_type_info = {
hw/scsi/vhost-scsi.c +1 -1
@@ -262,7 +262,7 @@ static void vhost_scsi_instance_init(Object *obj) vsc->feature_bits = kernel_feature_bits;device_add_bootindex_property (obj, &vsc->bootindex,"bootindex" ,NULL , -DEVICE (vsc),NULL ); +DEVICE (vsc),IGNORE_ERRORS ); }static const TypeInfo vhost_scsi_info = {
hw/scsi/vmw_pvscsi.c +1 -1
@@ -1065,7 +1065,7 @@ pvscsi_init_msi(PVSCSIState *s)PCIDevice *d =PCI_DEVICE (s); res =msi_init (d,PVSCSI_MSI_OFFSET (s),PVSCSI_MSIX_NUM_VECTORS , -PVSCSI_USE_64BIT ,PVSCSI_PER_VECTOR_MASK ,NULL ); +PVSCSI_USE_64BIT ,PVSCSI_PER_VECTOR_MASK ,IGNORE_ERRORS );if (res <0 ) {trace_pvscsi_init_msi_fail (res); s->msi_used = false;
hw/timer/mc146818rtc.c +3 -3
@@ -989,10 +989,10 @@ static void rtc_realizefn(DeviceState *dev, Error **errp)qdev_set_legacy_instance_id (dev, base,3 );qemu_register_reset (rtc_reset, s); -object_property_add_tm (OBJECT (s),"date" , rtc_get_date,NULL ); +object_property_add_tm (OBJECT (s),"date" , rtc_get_date,IGNORE_ERRORS );object_property_add_alias (qdev_get_machine (),"rtc-time" , -OBJECT (s),"date" ,NULL ); +OBJECT (s),"date" ,IGNORE_ERRORS );
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.11.0.259.g40922b1
Part of the diff is not shown here. View the raw message.
RFC 14/15 Eliminate unnecessary local_err/error_propagate() usage
In reply to Eduardo HabkostNow we can check for errors on errp using the ERR_IS_SET() macro, even if errors are being ignored.
Replace common local_err/error_propagate() usage using the following Coccinelle script:
@ simple_propagate @
typedef Error;
type T;
identifier FN;
expression some_func;
identifier errp;
identifier local_err;
@@
T FN(..., Error **errp)
{
...
- Error *local_err = NULL;
<... when != local_err
(
some_func(...,
- &local_err
+ errp
);
... when != local_err
(
error_propagate(errp, local_err);
|
if (local_err) {
... when != local_err
error_propagate(errp, local_err);
... when != local_err
}
)
|
if (
- local_err
+ ERR_IS_SET(errp)
) {
... when != local_err
- error_propagate(errp, local_err);
... when != local_err
}
|
- error_propagate(errp, local_err);
)
...>
}Quoted 1 line
From the 792
error_propagate()calls in the tree, 346 were automatically
converted by the script. Probably we can write a more complex script that catches many of the remaining cases later, or convert them manually.
--- qapi/qapi-visit-core.c | 6 +- backends/hostmem.c | 6 +- backends/rng.c | 6 +- backends/tpm.c | 6 +- block.c | 41 ++++------ block/blkdebug.c | 16 ++-- block/block-backend.c | 6 +- block/commit.c | 16 ++-- block/crypto.c | 6 +- block/curl.c | 6 +- block/file-posix.c | 6 +- block/gluster.c | 6 +- block/io.c | 11 +-- block/iscsi.c | 27 +++---- block/mirror.c | 12 +-- block/nbd.c | 18 ++--- block/nfs.c | 12 +-- block/qapi.c | 6 +- block/qcow2.c | 11 +-- block/raw-format.c | 6 +- block/rbd.c | 6 +- block/replication.c | 10 +-- block/sheepdog.c | 28 +++---- block/ssh.c | 12 +-- blockdev.c | 45 ++++------- blockjob.c | 13 +-- bootdevice.c | 13 +-- chardev/char.c | 6 +- dump.c | 153 +++++++++++------------------------- exec.c | 18 ++--- hw/arm/allwinner-a10.c | 26 +++--- hw/arm/armv7m.c | 26 +++--- hw/arm/digic.c | 21 ++--- hw/arm/fsl-imx25.c | 61 ++++++-------- hw/arm/fsl-imx31.c | 56 ++++++------- hw/arm/fsl-imx6.c | 76 +++++++----------- hw/arm/xlnx-zynqmp.c | 6 +- hw/block/fdc.c | 23 ++---- hw/block/pflash_cfi01.c | 6 +- hw/block/pflash_cfi02.c | 6 +- hw/block/virtio-blk.c | 16 ++-- hw/char/debugcon.c | 6 +- hw/char/serial-pci.c | 12 +-- hw/char/virtio-serial-bus.c | 6 +- hw/core/machine.c | 12 +-- hw/core/qdev-properties-system.c | 24 ++---- hw/core/qdev-properties.c | 47 ++++------- hw/core/qdev.c | 6 +- hw/cpu/a15mpcore.c | 6 +- hw/cpu/a9mpcore.c | 26 +++--- hw/cpu/arm11mpcore.c | 21 ++--- hw/cpu/core.c | 12 +-- hw/cpu/realview_mpcore.c | 11 +-- hw/display/qxl.c | 6 +- hw/display/virtio-gpu.c | 6 +- hw/display/virtio-vga.c | 6 +- hw/i386/kvm/pci-assign.c | 6 +- hw/i386/pc.c | 6 +- hw/input/virtio-input.c | 12 +-- hw/intc/apic_common.c | 6 +- hw/intc/arm_gic.c | 6 +- hw/intc/arm_gic_kvm.c | 11 +-- hw/intc/arm_gicv3.c | 6 +- hw/intc/arm_gicv3_its_kvm.c | 6 +- hw/intc/arm_gicv3_kvm.c | 11 +-- hw/intc/armv7m_nvic.c | 6 +- hw/intc/realview_gic.c | 6 +- hw/ipack/ipack.c | 4 +- hw/misc/ivshmem.c | 18 ++--- hw/misc/macio/macio.c | 33 +++----- hw/misc/tmp105.c | 6 +- hw/net/dp8393x.c | 6 +- hw/nvram/fw_cfg.c | 12 +-- hw/pci-bridge/pci_expander_bridge.c | 6 +- hw/pci/pci.c | 17 ++-- hw/pci/shpc.c | 12 +-- hw/ppc/e500.c | 6 +- hw/ppc/pnv.c | 32 +++----- hw/ppc/pnv_core.c | 16 ++-- hw/ppc/spapr.c | 12 +-- hw/ppc/spapr_drc.c | 26 +++--- hw/ppc/spapr_pci.c | 12 +-- hw/s390x/css-bridge.c | 6 +- hw/s390x/css.c | 6 +- hw/s390x/virtio-ccw.c | 16 ++-- hw/scsi/esp-pci.c | 6 +- hw/scsi/scsi-bus.c | 17 ++-- hw/scsi/scsi-disk.c | 11 +-- hw/scsi/vhost-scsi.c | 11 +-- hw/scsi/virtio-scsi.c | 6 +- hw/usb/bus.c | 32 +++----- hw/usb/dev-serial.c | 6 +- hw/usb/hcd-ohci.c | 12 +-- hw/usb/hcd-uhci.c | 6 +- hw/vfio/pci.c | 11 +-- hw/virtio/virtio-balloon.c | 6 +- hw/virtio/virtio-pci.c | 6 +- hw/virtio/virtio-rng.c | 6 +- hw/virtio/virtio.c | 17 ++-- migration/colo.c | 12 +-- migration/migration.c | 6 +- net/filter.c | 6 +- net/tap.c | 6 +- qapi/string-input-visitor.c | 6 +- qdev-monitor.c | 6 +- qga/commands-posix.c | 80 ++++++------------- qga/commands-win32.c | 18 ++--- qmp.c | 11 +-- qom/object.c | 84 +++++++------------- replication.c | 24 ++---- target/alpha/cpu.c | 6 +- target/arm/cpu.c | 6 +- target/cris/cpu.c | 6 +- target/hppa/cpu.c | 6 +- target/i386/cpu.c | 42 ++++------ target/lm32/cpu.c | 6 +- target/m68k/cpu.c | 6 +- target/microblaze/cpu.c | 6 +- target/mips/cpu.c | 6 +- target/moxie/cpu.c | 6 +- target/nios2/cpu.c | 6 +- target/openrisc/cpu.c | 6 +- target/ppc/translate_init.c | 23 ++---- target/s390x/cpu.c | 6 +- target/sh4/cpu.c | 6 +- target/sparc/cpu.c | 6 +- target/tilegx/cpu.c | 6 +- target/tricore/cpu.c | 6 +- target/unicore32/cpu.c | 6 +- target/xtensa/cpu.c | 6 +- util/qemu-config.c | 6 +- util/qemu-option.c | 18 ++--- 132 files changed, 691 insertions(+), 1310 deletions(-)
qapi/qapi-visit-core.c +2 -4
@@ -351,13 +351,11 @@ static void output_type_enum(Visitor *v, const char *name, int *obj,static void input_type_enum (Visitor *v,const char *name,int *obj,const char *const strings[],Error **errp) { -Error *local_err =NULL ;int64_t value =0 ;char *enum_str; -visit_type_str (v, name, &enum_str, &local_err); -if (local_err) { -error_propagate (errp, local_err); +visit_type_str (v, name, &enum_str, errp); +if (ERR_IS_SET (errp)) {return ; }
backends/hostmem.c +2 -4
@@ -197,7 +197,6 @@ static bool host_memory_backend_get_prealloc(Object *obj, Error **errp)static void host_memory_backend_set_prealloc (Object *obj,bool value,Error **errp) { -Error *local_err =NULL ;HostMemoryBackend *backend =MEMORY_BACKEND (obj);if (backend->force_prealloc) {
@@ -218,9 +217,8 @@ static void host_memory_backend_set_prealloc(Object *obj, bool value,void *ptr =memory_region_get_ram_ptr (&backend->mr);uint64_t sz =memory_region_size (&backend->mr); -os_mem_prealloc (fd, ptr, sz, smp_cpus, &local_err); -if (local_err) { -error_propagate (errp, local_err); +os_mem_prealloc (fd, ptr, sz, smp_cpus, errp); +if (ERR_IS_SET (errp)) {return ; } backend->prealloc = true;
backends/rng.c +2 -4
@@ -54,7 +54,6 @@ static void rng_backend_prop_set_opened(Object *obj, bool value, Error **errp) {RngBackend *s =RNG_BACKEND (obj);RngBackendClass *k =RNG_BACKEND_GET_CLASS (s); -Error *local_err =NULL ;if (value == s->opened) {return ;
@@ -66,9 +65,8 @@ static void rng_backend_prop_set_opened(Object *obj, bool value, Error **errp) }if (k->opened) { - k->opened (s, &local_err); -if (local_err) { -error_propagate (errp, local_err); + k->opened (s, errp); +if (ERR_IS_SET (errp)) {return ; } }
backends/tpm.c +2 -4
@@ -128,7 +128,6 @@ static void tpm_backend_prop_set_opened(Object *obj, bool value, Error **errp) {TPMBackend *s =TPM_BACKEND (obj);TPMBackendClass *k =TPM_BACKEND_GET_CLASS (s); -Error *local_err =NULL ;if (value == s->opened) {return ;
@@ -140,9 +139,8 @@ static void tpm_backend_prop_set_opened(Object *obj, bool value, Error **errp) }if (k->opened) { - k->opened (s, &local_err); -if (local_err) { -error_propagate (errp, local_err); + k->opened (s, errp); +if (ERR_IS_SET (errp)) {return ; } }
block.c +14 -27
107 lines not on this page · raw message
block/blkdebug.c +6 -10
@@ -246,7 +246,6 @@ static int read_config(BDRVBlkdebugState *s, const char *filename,FILE *f =NULL ;int ret;struct add_rule_data d; -Error *local_err =NULL ;if (filename) { f =fopen (filename,"r" );
@@ -263,26 +262,23 @@ static int read_config(BDRVBlkdebugState *s, const char *filename, } } -qemu_config_parse_qdict (options, config_groups, &local_err); -if (local_err) { -error_propagate (errp, local_err); +qemu_config_parse_qdict (options, config_groups, errp); +if (ERR_IS_SET (errp)) { ret = -EINVAL ; goto fail; } d.s = s; d.action =ACTION_INJECT_ERROR ; -qemu_opts_foreach (&inject_error_opts, add_rule, &d, &local_err); -if (local_err) { -error_propagate (errp, local_err); +qemu_opts_foreach (&inject_error_opts, add_rule, &d, errp); +if (ERR_IS_SET (errp)) { ret = -EINVAL ; goto fail; } d.action =ACTION_SET_STATE ; -qemu_opts_foreach (&set_state_opts, add_rule, &d, &local_err); -if (local_err) { -error_propagate (errp, local_err); +qemu_opts_foreach (&set_state_opts, add_rule, &d, errp); +if (ERR_IS_SET (errp)) { ret = -EINVAL ; goto fail; }
block/block-backend.c +2 -4
@@ -141,7 +141,6 @@ static const char *blk_root_get_name(BdrvChild *child)static void blk_root_activate (BdrvChild *child,Error **errp) {BlockBackend *blk = child->opaque; -Error *local_err =NULL ;if (!blk->disable_perm) {return ;
@@ -149,9 +148,8 @@ static void blk_root_activate(BdrvChild *child, Error **errp) blk->disable_perm = false; -blk_set_perm (blk, blk->perm, blk->shared_perm, &local_err); -if (local_err) { -error_propagate (errp, local_err); +blk_set_perm (blk, blk->perm, blk->shared_perm, errp); +if (ERR_IS_SET (errp)) { blk->disable_perm = true;return ; }
block/commit.c +6 -10
@@ -293,7 +293,6 @@ void commit_start(const char *job_id, BlockDriverState *bs,BlockDriverState *iter;BlockDriverState *overlay_bs;BlockDriverState *commit_top_bs =NULL ; -Error *local_err =NULL ;int ret;assert (top != bs);
@@ -328,9 +327,8 @@ void commit_start(const char *job_id, BlockDriverState *bs, orig_overlay_flags | BDRV_O_RDWR); }if (reopen_queue) { -bdrv_reopen_multiple (bdrv_get_aio_context (bs), reopen_queue, &local_err); -if (local_err !=NULL ) { -error_propagate (errp, local_err); +bdrv_reopen_multiple (bdrv_get_aio_context (bs), reopen_queue, errp); +if (ERR_IS_SET (errp)) { goto fail; } }
@@ -345,18 +343,16 @@ void commit_start(const char *job_id, BlockDriverState *bs, commit_top_bs->total_sectors = top->total_sectors;bdrv_set_aio_context (commit_top_bs,bdrv_get_aio_context (top)); -bdrv_set_backing_hd (commit_top_bs, top, &local_err); -if (local_err) { +bdrv_set_backing_hd (commit_top_bs, top, errp); +if (ERR_IS_SET (errp)) {bdrv_unref (commit_top_bs); commit_top_bs =NULL ; -error_propagate (errp, local_err); goto fail; } -bdrv_set_backing_hd (overlay_bs, commit_top_bs, &local_err); -if (local_err) { +bdrv_set_backing_hd (overlay_bs, commit_top_bs, errp); +if (ERR_IS_SET (errp)) {bdrv_unref (commit_top_bs); commit_top_bs =NULL ; -error_propagate (errp, local_err); goto fail; }
block/crypto.c +2 -4
@@ -295,7 +295,6 @@ static int block_crypto_open_generic(QCryptoBlockFormat format, {BlockCrypto *crypto = bs->opaque;QemuOpts *opts =NULL ; -Error *local_err =NULL ;int ret = -EINVAL ;QCryptoBlockOpenOptions *open_opts =NULL ;unsigned int cflags =0 ;
@@ -307,9 +306,8 @@ static int block_crypto_open_generic(QCryptoBlockFormat format, } opts =qemu_opts_create (opts_spec,NULL ,0 , &error_abort); -qemu_opts_absorb_qdict (opts, options, &local_err); -if (local_err) { -error_propagate (errp, local_err); +qemu_opts_absorb_qdict (opts, options, errp); +if (ERR_IS_SET (errp)) { goto cleanup; }
block/curl.c +2 -4
@@ -679,7 +679,6 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags,BDRVCURLState *s = bs->opaque;CURLState *state =NULL ;QemuOpts *opts; -Error *local_err =NULL ;const char *file;const char *cookie;const char *cookie_secret;
@@ -696,9 +695,8 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags,qemu_mutex_init (&s->mutex); opts =qemu_opts_create (&runtime_opts,NULL ,0 , &error_abort); -qemu_opts_absorb_qdict (opts, options, &local_err); -if (local_err) { -error_propagate (errp, local_err); +qemu_opts_absorb_qdict (opts, options, errp); +if (ERR_IS_SET (errp)) { goto out_noclean; }
block/file-posix.c +2 -4
@@ -756,7 +756,6 @@ static int raw_reopen_prepare(BDRVReopenState *state,BDRVRawState *s;BDRVRawReopenState *rs;int ret =0 ; -Error *local_err =NULL ;assert (state !=NULL );assert (state->bs !=NULL );
@@ -819,11 +818,10 @@ static int raw_reopen_prepare(BDRVReopenState *state,/* Fail already reopen_prepare() if we can't get a working O_DIRECT * alignment with the new fd. */ if (rs->fd !=-1 ) { -raw_probe_alignment (state->bs, rs->fd, &local_err); -if (local_err) { +raw_probe_alignment (state->bs, rs->fd, errp); +if (ERR_IS_SET (errp)) {qemu_close (rs->fd); rs->fd =-1 ; -error_propagate (errp, local_err); ret = -EINVAL ; } }
block/gluster.c +2 -4
@@ -765,13 +765,11 @@ static int qemu_gluster_open(BlockDriverState *bs, QDict *options,int ret =0 ;BlockdevOptionsGluster *gconf =NULL ;QemuOpts *opts; -Error *local_err =NULL ;const char *filename, *logfile; opts =qemu_opts_create (&runtime_opts,NULL ,0 , &error_abort); -qemu_opts_absorb_qdict (opts, options, &local_err); -if (local_err) { -error_propagate (errp, local_err); +qemu_opts_absorb_qdict (opts, options, errp); +if (ERR_IS_SET (errp)) { ret = -EINVAL ; goto out; }
block/io.c +4 -7
@@ -81,7 +81,6 @@ static void bdrv_merge_limits(BlockLimits *dst, const BlockLimits *src)void bdrv_refresh_limits (BlockDriverState *bs,Error **errp) {BlockDriver *drv = bs->drv; -Error *local_err =NULL ;memset (&bs->bl,0 ,sizeof (bs->bl));
@@ -94,9 +93,8 @@ void bdrv_refresh_limits(BlockDriverState *bs, Error **errp)/* Take some limits from the children as a default */ if (bs->file) { -bdrv_refresh_limits (bs->file->bs, &local_err); -if (local_err) { -error_propagate (errp, local_err); +bdrv_refresh_limits (bs->file->bs, errp); +if (ERR_IS_SET (errp)) {return ; }bdrv_merge_limits (&bs->bl, &bs->file->bs->bl);
@@ -109,9 +107,8 @@ void bdrv_refresh_limits(BlockDriverState *bs, Error **errp) }if (bs->backing) { -bdrv_refresh_limits (bs->backing->bs, &local_err); -if (local_err) { -error_propagate (errp, local_err); +bdrv_refresh_limits (bs->backing->bs, errp); +if (ERR_IS_SET (errp)) {return ; }bdrv_merge_limits (&bs->bl, &bs->backing->bs->bl);
block/iscsi.c +10 -17
@@ -1747,7 +1747,6 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,struct scsi_inquiry_supported_pages *inq_vpd;char *initiator_name =NULL ;QemuOpts *opts; -Error *local_err =NULL ;const char *transport_name, *portal, *target;#if LIBISCSI_API_VERSION >= (20160603 )enum iscsi_transport_type transport;
@@ -1755,9 +1754,8 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,int i, ret =0 , timeout =0 , lun; opts =qemu_opts_create (&runtime_opts,NULL ,0 , &error_abort); -qemu_opts_absorb_qdict (opts, options, &local_err); -if (local_err) { -error_propagate (errp, local_err); +qemu_opts_absorb_qdict (opts, options, errp); +if (ERR_IS_SET (errp)) { ret = -EINVAL ; goto out; }
@@ -1811,9 +1809,8 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags, }/* check if we got CHAP username/password via the options */ -apply_chap (iscsi, opts, &local_err); -if (local_err !=NULL ) { -error_propagate (errp, local_err); +apply_chap (iscsi, opts, errp); +if (ERR_IS_SET (errp)) { ret = -EINVAL ; goto out; }
@@ -1825,9 +1822,8 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags, }/* check if we got HEADER_DIGEST via the options */ -apply_header_digest (iscsi, opts, &local_err); -if (local_err !=NULL ) { -error_propagate (errp, local_err); +apply_header_digest (iscsi, opts, errp); +if (ERR_IS_SET (errp)) { ret = -EINVAL ; goto out; }
@@ -1878,9 +1874,8 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags, goto out; } -iscsi_readcapacity_sync (iscsilun, &local_err); -if (local_err !=NULL ) { -error_propagate (errp, local_err); +iscsi_readcapacity_sync (iscsilun, errp); +if (ERR_IS_SET (errp)) { ret = -EINVAL ; goto out; }
@@ -2063,16 +2058,14 @@ static void iscsi_reopen_commit(BDRVReopenState *reopen_state)static int iscsi_truncate (BlockDriverState *bs,int64_t offset,Error **errp) {IscsiLun *iscsilun = bs->opaque; -Error *local_err =NULL ;if (iscsilun->type !=TYPE_DISK ) {error_setg (errp,"Cannot resize non-disk iSCSI devices" );return -ENOTSUP ; } -iscsi_readcapacity_sync (iscsilun, &local_err); -if (local_err !=NULL ) { -error_propagate (errp, local_err); +iscsi_readcapacity_sync (iscsilun, errp); +if (ERR_IS_SET (errp)) {return -EIO ; }
block/mirror.c +4 -8
@@ -1127,7 +1127,6 @@ static void mirror_start_job(const char *job_id, BlockDriverState *bs,BlockDriverState *mirror_top_bs;bool target_graph_mod;bool target_is_backing; -Error *local_err =NULL ;int ret;if (granularity ==0 ) {
@@ -1160,12 +1159,11 @@ static void mirror_start_job(const char *job_id, BlockDriverState *bs,* it alive until block_job_create() succeeds even if bs has no parent. */ bdrv_ref (mirror_top_bs);bdrv_drained_begin (bs); -bdrv_append (mirror_top_bs, bs, &local_err); +bdrv_append (mirror_top_bs, bs, errp);bdrv_drained_end (bs); -if (local_err) { +if (ERR_IS_SET (errp)) {bdrv_unref (mirror_top_bs); -error_propagate (errp, local_err);return ; }
@@ -1299,7 +1297,6 @@ void commit_active_start(const char *job_id, BlockDriverState *bs, bool auto_complete, Error **errp) { int orig_base_flags; -Error *local_err =NULL ; orig_base_flags =bdrv_get_flags (base);
@@ -1311,9 +1308,8 @@ void commit_active_start(const char *job_id, BlockDriverState *bs,MIRROR_LEAVE_BACKING_CHAIN , on_error, on_error, true, cb, opaque, &commit_active_job_driver, false, base, auto_complete, - filter_node_name, &local_err); -if (local_err) { -error_propagate (errp, local_err); + filter_node_name, errp); +if (ERR_IS_SET (errp)) { goto error_restore_flags; }
block/nbd.c +6 -12
@@ -265,7 +265,6 @@ static SocketAddress *nbd_config(BDRVNBDState *s, QDict *options,QDict *addr =NULL ;QObject *crumpled_addr =NULL ;Visitor *iv =NULL ; -Error *local_err =NULL ;qdict_extract_subqdict (options, &addr,"server." );if (!qdict_size (addr)) {
@@ -287,9 +286,8 @@ static SocketAddress *nbd_config(BDRVNBDState *s, QDict *options,* visitor expects the former. */ iv =qobject_input_visitor_new (crumpled_addr); -visit_type_SocketAddress (iv,NULL , &saddr, &local_err); -if (local_err) { -error_propagate (errp, local_err); +visit_type_SocketAddress (iv,NULL , &saddr, errp); +if (ERR_IS_SET (errp)) { goto done; }
@@ -310,17 +308,15 @@ static QIOChannelSocket *nbd_establish_connection(SocketAddress *saddr, Error **errp) {QIOChannelSocket *sioc; -Error *local_err =NULL ; sioc =qio_channel_socket_new ();qio_channel_set_name (QIO_CHANNEL (sioc),"nbd-client" );qio_channel_socket_connect_sync (sioc, saddr, - &local_err); -if (local_err) { + errp); +if (ERR_IS_SET (errp)) {object_unref (OBJECT (sioc)); -error_propagate (errp, local_err);return NULL ; }
@@ -397,16 +393,14 @@ static int nbd_open(BlockDriverState *bs, QDict *options, int flags, {BDRVNBDState *s = bs->opaque;QemuOpts *opts =NULL ; -Error *local_err =NULL ;QIOChannelSocket *sioc =NULL ;QCryptoTLSCreds *tlscreds =NULL ;const char *hostname =NULL ;int ret = -EINVAL ; opts =qemu_opts_create (&nbd_runtime_opts,NULL ,0 , &error_abort); -qemu_opts_absorb_qdict (opts, options, &local_err); -if (local_err) { -error_propagate (errp, local_err); +qemu_opts_absorb_qdict (opts, options, errp); +if (ERR_IS_SET (errp)) { goto error; }
block/nfs.c +4 -8
@@ -455,7 +455,6 @@ static NFSServer *nfs_config(QDict *options, Error **errp)QDict *addr =NULL ;QObject *crumpled_addr =NULL ;Visitor *iv =NULL ; -Error *local_error =NULL ;qdict_extract_subqdict (options, &addr,"server." );if (!qdict_size (addr)) {
@@ -476,9 +475,8 @@ static NFSServer *nfs_config(QDict *options, Error **errp)* they come from -drive, they're all QString. */ iv =qobject_input_visitor_new (crumpled_addr); -visit_type_NFSServer (iv,NULL , &server, &local_error); -if (local_error) { -error_propagate (errp, local_error); +visit_type_NFSServer (iv,NULL , &server, errp); +if (ERR_IS_SET (errp)) { goto out; }
@@ -495,14 +493,12 @@ static int64_t nfs_client_open(NFSClient *client, QDict *options, {int ret = -EINVAL ;QemuOpts *opts =NULL ; -Error *local_err =NULL ;struct stat st;char *file =NULL , *strp =NULL ; opts =qemu_opts_create (&runtime_opts,NULL ,0 , &error_abort); -qemu_opts_absorb_qdict (opts, options, &local_err); -if (local_err) { -error_propagate (errp, local_err); +qemu_opts_absorb_qdict (opts, options, errp); +if (ERR_IS_SET (errp)) { ret = -EINVAL ; goto fail; }
block/qapi.c +2 -4
@@ -460,13 +460,11 @@ BlockInfoList *qmp_query_block(Error **errp) {BlockInfoList *head =NULL , **p_next = &head;BlockBackend *blk; -Error *local_err =NULL ;for (blk =blk_next (NULL ); blk; blk =blk_next (blk)) {BlockInfoList *info =g_malloc0 (sizeof (*info)); -bdrv_query_info (blk, &info->value, &local_err); -if (local_err) { -error_propagate (errp, local_err); +bdrv_query_info (blk, &info->value, errp); +if (ERR_IS_SET (errp)) {g_free (info);qapi_free_BlockInfoList (head);return NULL ;
block/qcow2.c +4 -7
@@ -598,22 +598,19 @@ static int qcow2_update_options_prepare(BlockDriverState *bs,int overlap_check_template =0 ;uint64_t l2_cache_size, refcount_cache_size;int i; -Error *local_err =NULL ;int ret; opts =qemu_opts_create (&qcow2_runtime_opts,NULL ,0 , &error_abort); -qemu_opts_absorb_qdict (opts, options, &local_err); -if (local_err) { -error_propagate (errp, local_err); +qemu_opts_absorb_qdict (opts, options, errp); +if (ERR_IS_SET (errp)) { ret = -EINVAL ; goto fail; }/* get L2 table/refcount block cache size from command line options */ read_cache_sizes (bs, opts, &l2_cache_size, &refcount_cache_size, - &local_err); -if (local_err) { -error_propagate (errp, local_err); + errp); +if (ERR_IS_SET (errp)) { ret = -EINVAL ; goto fail; }
block/raw-format.c +2 -4
@@ -71,7 +71,6 @@ static QemuOptsList raw_create_opts = {static int raw_read_options (QDict *options,BlockDriverState *bs,BDRVRawState *s,Error **errp) { -Error *local_err =NULL ;QemuOpts *opts =NULL ;int64_t real_size =0 ;int ret;
@@ -83,9 +82,8 @@ static int raw_read_options(QDict *options, BlockDriverState *bs, } opts =qemu_opts_create (&raw_runtime_opts,NULL ,0 , &error_abort); -qemu_opts_absorb_qdict (opts, options, &local_err); -if (local_err) { -error_propagate (errp, local_err); +qemu_opts_absorb_qdict (opts, options, errp); +if (ERR_IS_SET (errp)) { ret = -EINVAL ; goto end; }
block/rbd.c +2 -4
@@ -346,7 +346,6 @@ static QemuOptsList runtime_opts = {static int qemu_rbd_create (const char *filename,QemuOpts *opts,Error **errp) { -Error *local_err =NULL ;int64_t bytes =0 ;int64_t objsize;int obj_order =0 ;
@@ -378,10 +377,9 @@ static int qemu_rbd_create(const char *filename, QemuOpts *opts, Error **errp) } options =qdict_new (); -qemu_rbd_parse_filename (filename, options, &local_err); -if (local_err) { +qemu_rbd_parse_filename (filename, options, errp); +if (ERR_IS_SET (errp)) { ret = -EINVAL ; -error_propagate (errp, local_err); goto exit; }
block/replication.c +3 -7
@@ -313,7 +313,6 @@ static bool replication_recurse_is_first_non_filter(BlockDriverState *bs,static void secondary_do_checkpoint (BDRVReplicationState *s,Error **errp) { -Error *local_err =NULL ;int ret;if (!s->secondary_disk->bs->job) {
@@ -321,9 +320,8 @@ static void secondary_do_checkpoint(BDRVReplicationState *s, Error **errp)return ; } -backup_do_checkpoint (s->secondary_disk->bs->job, &local_err); -if (local_err) { -error_propagate (errp, local_err); +backup_do_checkpoint (s->secondary_disk->bs->job, errp); +if (ERR_IS_SET (errp)) {return ; }
@@ -347,7 +345,6 @@ static void reopen_backing_file(BlockDriverState *bs, bool writable,BlockReopenQueue *reopen_queue =NULL ;int orig_hidden_flags, orig_secondary_flags;int new_hidden_flags, new_secondary_flags; -Error *local_err =NULL ;if (writable) { orig_hidden_flags = s->orig_hidden_flags =
@@ -379,8 +376,7 @@ static void reopen_backing_file(BlockDriverState *bs, bool writable,if (reopen_queue) {bdrv_reopen_multiple (bdrv_get_aio_context (bs), - reopen_queue, &local_err); -error_propagate (errp, local_err); + reopen_queue, errp); } }
block/sheepdog.c +10 -18
@@ -553,7 +553,6 @@ static SocketAddress *sd_server_config(QDict *options, Error **errp)QObject *crumpled_server =NULL ;Visitor *iv =NULL ;SocketAddress *saddr =NULL ; -Error *local_err =NULL ;qdict_extract_subqdict (options, &server,"server." );
@@ -571,9 +570,8 @@ static SocketAddress *sd_server_config(QDict *options, Error **errp)* visitor expects the former. */ iv =qobject_input_visitor_new (crumpled_server); -visit_type_SocketAddress (iv,NULL , &saddr, &local_err); -if (local_err) { -error_propagate (errp, local_err); +visit_type_SocketAddress (iv,NULL , &saddr, errp); +if (ERR_IS_SET (errp)) { goto done; }
@@ -1197,17 +1195,15 @@ static void parse_vdiname(SheepdogConfig *cfg, const char *filename,static void sd_parse_filename (const char *filename,QDict *options,Error **errp) { -Error *err =NULL ;SheepdogConfig cfg;char buf[32 ];if (strstr (filename,"://" )) { -sd_parse_uri (&cfg, filename, &err); +sd_parse_uri (&cfg, filename, errp); }else { -parse_vdiname (&cfg, filename, &err); +parse_vdiname (&cfg, filename, errp); } -if (err) { -error_propagate (errp, err); +if (ERR_IS_SET (errp)) {return ; }
@@ -1572,15 +1568,13 @@ static int sd_open(BlockDriverState *bs, QDict *options, int flags,uint64_t snap_id;char *buf =NULL ;QemuOpts *opts; -Error *local_err =NULL ; s->bs = bs; s->aio_context =bdrv_get_aio_context (bs); opts =qemu_opts_create (&runtime_opts,NULL ,0 , &error_abort); -qemu_opts_absorb_qdict (opts, options, &local_err); -if (local_err) { -error_propagate (errp, local_err); +qemu_opts_absorb_qdict (opts, options, errp); +if (ERR_IS_SET (errp)) { ret = -EINVAL ; goto err_no_fd; }
@@ -1955,7 +1949,6 @@ static int parse_block_size_shift(BDRVSheepdogState *s, QemuOpts *opt)static int sd_create (const char *filename,QemuOpts *opts,Error **errp) { -Error *err =NULL ;int ret =0 ;uint32_t vid =0 ;char *backing_file =NULL ;
@@ -1968,12 +1961,11 @@ static int sd_create(const char *filename, QemuOpts *opts, s =g_new0 (BDRVSheepdogState,1 );if (strstr (filename,"://" )) { -sd_parse_uri (&cfg, filename, &err); +sd_parse_uri (&cfg, filename, errp); }else { -parse_vdiname (&cfg, filename, &err); +parse_vdiname (&cfg, filename, errp); } -if (err) { -error_propagate (errp, err); +if (ERR_IS_SET (errp)) { goto out; }
block/ssh.c +4 -8
@@ -586,7 +586,6 @@ static InetSocketAddress *ssh_config(QDict *options, Error **errp)QDict *addr =NULL ;QObject *crumpled_addr =NULL ;Visitor *iv =NULL ; -Error *local_error =NULL ;qdict_extract_subqdict (options, &addr,"server." );if (!qdict_size (addr)) {
@@ -608,9 +607,8 @@ static InetSocketAddress *ssh_config(QDict *options, Error **errp)* visitor expects the former. */ iv =qobject_input_visitor_new (crumpled_addr); -visit_type_InetSocketAddress (iv,NULL , &inet, &local_error); -if (local_error) { -error_propagate (errp, local_error); +visit_type_InetSocketAddress (iv,NULL , &inet, errp); +if (ERR_IS_SET (errp)) { goto out; }
@@ -626,15 +624,13 @@ static int connect_to_ssh(BDRVSSHState *s, QDict *options, {int r, ret;QemuOpts *opts =NULL ; -Error *local_err =NULL ;const char *user, *path, *host_key_check;long port =0 ; opts =qemu_opts_create (&ssh_runtime_opts,NULL ,0 , &error_abort); -qemu_opts_absorb_qdict (opts, options, &local_err); -if (local_err) { +qemu_opts_absorb_qdict (opts, options, errp); +if (ERR_IS_SET (errp)) { ret = -EINVAL ; -error_propagate (errp, local_err); goto err; }
blockdev.c +15 -30
130 lines not on this page · raw message
blockjob.c +4 -9
@@ -356,7 +356,6 @@ static int block_job_finish_sync(BlockJob *job,void (*finish)(BlockJob *,Error **errp), Error **errp) { - Error *local_err = NULL; int ret;assert (blk_bs (job->blk)->job == job);
@@ -364,10 +363,9 @@ static int block_job_finish_sync(BlockJob *job,block_job_ref (job);if (finish) { -finish (job, &local_err); +finish (job, errp); } -if (local_err) { -error_propagate (errp, local_err); +if (ERR_IS_SET (errp)) {block_job_unref (job);return -EBUSY ; }
@@ -454,15 +452,12 @@ static void block_job_completed_txn_success(BlockJob *job)void block_job_set_speed (BlockJob *job,int64_t speed,Error **errp) { -Error *local_err =NULL ; -if (!job->driver->set_speed) {error_setg (errp,QERR_UNSUPPORTED );return ; } - job->driver->set_speed (job, speed, &local_err); -if (local_err) { -error_propagate (errp, local_err); + job->driver->set_speed (job, speed, errp); +if (ERR_IS_SET (errp)) {return ; }
bootdevice.c +4 -9
@@ -52,17 +52,14 @@ void qemu_register_boot_set(QEMUBootSetHandler *func, void *opaque)void qemu_boot_set (const char *boot_order,Error **errp) { -Error *local_err =NULL ; -if (!boot_set_handler) {error_setg (errp,"no function defined to set boot device list for" " this architecture" );return ; } -validate_bootdevices (boot_order, &local_err); -if (local_err) { -error_propagate (errp, local_err); +validate_bootdevices (boot_order, errp); +if (ERR_IS_SET (errp)) {return ; }
@@ -319,7 +316,6 @@ void device_add_bootindex_property(Object *obj, int32_t *bootindex, const char *name, const char *suffix, DeviceState *dev, Error **errp) { - Error *local_err = NULL; BootIndexProperty *prop = g_malloc0(sizeof(*prop)); prop->bootindex = bootindex;
@@ -330,10 +326,9 @@ void device_add_bootindex_property(Object *obj, int32_t *bootindex, device_get_bootindex, device_set_bootindex, property_release_bootindex, - prop, &local_err); + prop, errp); -if (local_err) { -error_propagate (errp, local_err); +if (ERR_IS_SET (errp)) {g_free (prop);return ; }
chardev/char.c +2 -4
@@ -559,7 +559,6 @@ help_string_append(const char *name, void *opaque)Chardev *qemu_chr_new_from_opts (QemuOpts *opts,Error **errp) { -Error *local_err =NULL ;const ChardevClass *cc;Chardev *chr;int i;
@@ -610,9 +609,8 @@ Chardev *qemu_chr_new_from_opts(QemuOpts *opts, chr =NULL ;if (cc->parse) { - cc->parse (opts, backend, &local_err); -if (local_err) { -error_propagate (errp, local_err); + cc->parse (opts, backend, errp); +if (ERR_IS_SET (errp)) { goto out; } }else {
dump.c +46 -107
323 lines not on this page · raw message
exec.c +6 -12
@@ -1860,7 +1860,6 @@ static void ram_block_add(RAMBlock *new_block, Error **errp)RAMBlock *block;RAMBlock *last_block =NULL ;ram_addr_t old_ram_size, new_ram_size; -Error *err =NULL ; old_ram_size =last_ram_page ();
@@ -1870,9 +1869,8 @@ static void ram_block_add(RAMBlock *new_block, Error **errp)if (!new_block->host) {if (xen_enabled ()) {xen_ram_alloc (new_block->offset, new_block->max_length, - new_block->mr, &err); -if (err) { -error_propagate (errp, err); + new_block->mr, errp); +if (ERR_IS_SET (errp)) {qemu_mutex_unlock_ramlist ();return ; }
@@ -1938,7 +1936,6 @@ RAMBlock *qemu_ram_alloc_from_file(ram_addr_t size, MemoryRegion *mr, Error **errp) {RAMBlock *new_block; -Error *local_err =NULL ;if (xen_enabled ()) {error_setg (errp,"-mem-path not supported with Xen" );
@@ -1969,10 +1966,9 @@ RAMBlock *qemu_ram_alloc_from_file(ram_addr_t size, MemoryRegion *mr,return NULL ; } -ram_block_add (new_block, &local_err); -if (local_err) { +ram_block_add (new_block, errp); +if (ERR_IS_SET (errp)) {g_free (new_block); -error_propagate (errp, local_err);return NULL ; }return new_block;
@@ -1988,7 +1984,6 @@ RAMBlock *qemu_ram_alloc_internal(ram_addr_t size, ram_addr_t max_size, MemoryRegion *mr, Error **errp) {RAMBlock *new_block; -Error *local_err =NULL ; size =HOST_PAGE_ALIGN (size); max_size =HOST_PAGE_ALIGN (max_size);
@@ -2007,10 +2002,9 @@ RAMBlock *qemu_ram_alloc_internal(ram_addr_t size, ram_addr_t max_size,if (resizeable) { new_block->flags |=RAM_RESIZEABLE ; } -ram_block_add (new_block, &local_err); -if (local_err) { +ram_block_add (new_block, errp); +if (ERR_IS_SET (errp)) {g_free (new_block); -error_propagate (errp, local_err);return NULL ; }return new_block;
hw/arm/allwinner-a10.c +10 -16
@@ -54,19 +54,16 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)SysBusDevice *sysbusdev;uint8_t i;qemu_irq fiq, irq; -Error *err =NULL ; -object_property_set_bool (OBJECT (&s->cpu), true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->cpu), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; } irq =qdev_get_gpio_in (DEVICE (&s->cpu),ARM_CPU_IRQ ); fiq =qdev_get_gpio_in (DEVICE (&s->cpu),ARM_CPU_FIQ ); -object_property_set_bool (OBJECT (&s->intc), true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->intc), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; } sysbusdev =SYS_BUS_DEVICE (&s->intc);
@@ -77,9 +74,8 @@ static void aw_a10_realize(DeviceState *dev, Error **errp) s->irq[i] =qdev_get_gpio_in (DEVICE (&s->intc), i); } -object_property_set_bool (OBJECT (&s->timer), true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->timer), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; } sysbusdev =SYS_BUS_DEVICE (&s->timer);
@@ -91,18 +87,16 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)sysbus_connect_irq (sysbusdev,4 , s->irq[67 ]);sysbus_connect_irq (sysbusdev,5 , s->irq[68 ]); -object_property_set_bool (OBJECT (&s->emac), true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->emac), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; } sysbusdev =SYS_BUS_DEVICE (&s->emac);sysbus_mmio_map (sysbusdev,0 ,AW_A10_EMAC_BASE );sysbus_connect_irq (sysbusdev,0 , s->irq[55 ]); -object_property_set_bool (OBJECT (&s->sata), true,"realized" , &err); -if (err) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->sata), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; }sysbus_mmio_map (SYS_BUS_DEVICE (&s->sata),0 ,AW_A10_SATA_BASE );
hw/arm/armv7m.c +10 -16
@@ -161,7 +161,6 @@ static void armv7m_realize(DeviceState *dev, Error **errp) {ARMv7MState *s =ARMV7M (dev);SysBusDevice *sbd; -Error *err =NULL ;int i;char **cpustr;ObjectClass *oc;
@@ -186,10 +185,9 @@ static void armv7m_realize(DeviceState *dev, Error **errp) cc =CPU_CLASS (oc); typename =object_class_get_name (oc); - cc->parse_features (typename, cpustr[1 ], &err); + cc->parse_features (typename, cpustr[1 ], errp);g_strfreev (cpustr); -if (err) { -error_propagate (errp, err); +if (ERR_IS_SET (errp)) {return ; }
@@ -201,16 +199,14 @@ static void armv7m_realize(DeviceState *dev, Error **errp)object_property_set_link (OBJECT (s->cpu),OBJECT (&s->container),"memory" , &error_abort); -object_property_set_bool (OBJECT (s->cpu), true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (s->cpu), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; }/* Note that we must realize the NVIC after the CPU */ -object_property_set_bool (OBJECT (&s->nvic), true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->nvic), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; }
@@ -234,16 +230,14 @@ static void armv7m_realize(DeviceState *dev, Error **errp)Object *obj =OBJECT (&s->bitband[i]);SysBusDevice *sbd =SYS_BUS_DEVICE (&s->bitband[i]); -object_property_set_int (obj, bitband_input_addr[i],"base" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_int (obj, bitband_input_addr[i],"base" , errp); +if (ERR_IS_SET (errp)) {return ; }object_property_set_link (obj,OBJECT (s->board_memory),"source-memory" , &error_abort); -object_property_set_bool (obj, true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (obj, true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; }
hw/arm/digic.c +8 -13
@@ -59,26 +59,22 @@ static void digic_init(Object *obj)static void digic_realize (DeviceState *dev,Error **errp) {DigicState *s =DIGIC (dev); -Error *err =NULL ;SysBusDevice *sbd;int i; -object_property_set_bool (OBJECT (&s->cpu), true,"reset-hivecs" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->cpu), true,"reset-hivecs" , errp); +if (ERR_IS_SET (errp)) {return ; } -object_property_set_bool (OBJECT (&s->cpu), true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->cpu), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; }for (i =0 ; i <DIGIC4_NB_TIMERS ; i++) { -object_property_set_bool (OBJECT (&s->timer[i]), true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->timer[i]), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; }
@@ -87,9 +83,8 @@ static void digic_realize(DeviceState *dev, Error **errp) }qdev_prop_set_chr (DEVICE (&s->uart),"chardev" , serial_hds[0 ]); -object_property_set_bool (OBJECT (&s->uart), true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->uart), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; }
hw/arm/fsl-imx25.c +24 -37
130 lines not on this page · raw message
hw/arm/fsl-imx31.c +22 -34
120 lines not on this page · raw message
hw/arm/fsl-imx6.c +30 -46
170 lines not on this page · raw message
hw/arm/xlnx-zynqmp.c +2 -4
@@ -96,7 +96,6 @@ static inline int arm_gic_ppi_index(int cpu_nr, int ppi_index)static void xlnx_zynqmp_create_rpu (XlnxZynqMPState *s,const char *boot_cpu,Error **errp) { -Error *err =NULL ;int i;for (i =0 ; i <XLNX_ZYNQMP_NUM_RPU_CPUS ; i++) {
@@ -120,9 +119,8 @@ static void xlnx_zynqmp_create_rpu(XlnxZynqMPState *s, const char *boot_cpu,object_property_set_bool (OBJECT (&s->rpu_cpu[i]), true,"reset-hivecs" , &error_abort);object_property_set_bool (OBJECT (&s->rpu_cpu[i]), true,"realized" , - &err); -if (err) { -error_propagate (errp, err); + errp); +if (ERR_IS_SET (errp)) {return ; } }
hw/block/fdc.c +8 -15
@@ -473,16 +473,14 @@ static void fd_revalidate(FDrive *drv)static void fd_change_cb (void *opaque,bool load,Error **errp) {FDrive *drive = opaque; -Error *local_err =NULL ;if (!load) {blk_set_perm (drive->blk,0 ,BLK_PERM_ALL , &error_abort); }else {blkconf_apply_backend_options (drive->conf,blk_is_read_only (drive->blk), false, - &local_err); -if (local_err) { -error_propagate (errp, local_err); + errp); +if (ERR_IS_SET (errp)) {return ; } }
@@ -2528,7 +2526,6 @@ static void fdctrl_connect_drives(FDCtrl *fdctrl, DeviceState *fdc_dev,FDrive *drive;DeviceState *dev;BlockBackend *blk; -Error *local_err =NULL ;for (i =0 ; i <MAX_FD ; i++) { drive = &fdctrl->drives[i];
@@ -2550,17 +2547,15 @@ static void fdctrl_connect_drives(FDCtrl *fdctrl, DeviceState *fdc_dev,blk_ref (blk);blk_detach_dev (blk, fdc_dev); fdctrl->qdev_for_drives[i].blk =NULL ; -qdev_prop_set_drive (dev,"drive" , blk, &local_err); +qdev_prop_set_drive (dev,"drive" , blk, errp);blk_unref (blk); -if (local_err) { -error_propagate (errp, local_err); +if (ERR_IS_SET (errp)) {return ; } -object_property_set_bool (OBJECT (dev), true,"realized" , &local_err); -if (local_err) { -error_propagate (errp, local_err); +object_property_set_bool (OBJECT (dev), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; } }
@@ -2689,7 +2684,6 @@ static void isabus_fdc_realize(DeviceState *dev, Error **errp)ISADevice *isadev =ISA_DEVICE (dev);FDCtrlISABus *isa =ISA_FDC (dev);FDCtrl *fdctrl = &isa->state; -Error *err =NULL ; isa_register_portio_list(isadev, &fdctrl->portio_list, isa->iobase, fdc_portio_list, fdctrl,
@@ -2703,9 +2697,8 @@ static void isabus_fdc_realize(DeviceState *dev, Error **errp) }qdev_set_legacy_instance_id (dev, isa->iobase,2 ); -fdctrl_realize_common (dev, fdctrl, &err); -if (err !=NULL ) { -error_propagate (errp, err); +fdctrl_realize_common (dev, fdctrl, errp); +if (ERR_IS_SET (errp)) {return ; } }
hw/block/pflash_cfi01.c +2 -4
@@ -706,7 +706,6 @@ static void pflash_cfi01_realize(DeviceState *dev, Error **errp)int ret;uint64_t blocks_per_device, sector_len_per_device, device_len;int num_devices; -Error *local_err =NULL ;if (pfl->sector_len ==0 ) {error_setg (errp,"attribute \"sector-length\" not specified or zero." );
@@ -747,9 +746,8 @@ static void pflash_cfi01_realize(DeviceState *dev, Error **errp) &pfl->mem,OBJECT (dev), &pflash_cfi01_ops, pfl, - pfl->name, total_len, &local_err); -if (local_err) { -error_propagate (errp, local_err); + pfl->name, total_len, errp); +if (ERR_IS_SET (errp)) {return ; }
hw/block/pflash_cfi02.c +2 -4
@@ -598,7 +598,6 @@ static void pflash_cfi02_realize(DeviceState *dev, Error **errp)pflash_t *pfl =CFI_PFLASH02 (dev);uint32_t chip_len;int ret; -Error *local_err =NULL ;if (pfl->sector_len ==0 ) {error_setg (errp,"attribute \"sector-length\" not specified or zero." );
@@ -623,9 +622,8 @@ static void pflash_cfi02_realize(DeviceState *dev, Error **errp)memory_region_init_rom_device (&pfl->orig_mem,OBJECT (pfl), pfl->be ? &pflash_cfi02_ops_be : &pflash_cfi02_ops_le, - pfl, pfl->name, chip_len, &local_err); -if (local_err) { -error_propagate (errp, local_err); + pfl, pfl->name, chip_len, errp); +if (ERR_IS_SET (errp)) {return ; }
hw/block/virtio-blk.c +6 -10
@@ -909,7 +909,6 @@ static void virtio_blk_device_realize(DeviceState *dev, Error **errp)VirtIODevice *vdev =VIRTIO_DEVICE (dev);VirtIOBlock *s =VIRTIO_BLK (dev);VirtIOBlkConf *conf = &s->conf; -Error *err =NULL ;unsigned i;if (!conf->conf.blk) {
@@ -928,15 +927,13 @@ static void virtio_blk_device_realize(DeviceState *dev, Error **errp)blkconf_serial (&conf->conf, &conf->serial);blkconf_apply_backend_options (&conf->conf,blk_is_read_only (conf->conf.blk), true, - &err); -if (err) { -error_propagate (errp, err); + errp); +if (ERR_IS_SET (errp)) {return ; } s->original_wce =blk_enable_write_cache (conf->conf.blk); -blkconf_geometry (&conf->conf,NULL ,65535 ,255 ,255 , &err); -if (err) { -error_propagate (errp, err); +blkconf_geometry (&conf->conf,NULL ,65535 ,255 ,255 , errp); +if (ERR_IS_SET (errp)) {return ; }blkconf_blocksizes (&conf->conf);
@@ -951,9 +948,8 @@ static void virtio_blk_device_realize(DeviceState *dev, Error **errp)for (i =0 ; i < conf->num_queues; i++) {virtio_add_queue (vdev,128 , virtio_blk_handle_output); } -virtio_blk_data_plane_create (vdev, conf, &s->dataplane, &err); -if (err !=NULL ) { -error_propagate (errp, err); +virtio_blk_data_plane_create (vdev, conf, &s->dataplane, errp); +if (ERR_IS_SET (errp)) {virtio_cleanup (vdev);return ; }
hw/char/debugcon.c +2 -4
@@ -100,11 +100,9 @@ static void debugcon_isa_realizefn(DeviceState *dev, Error **errp)ISADevice *d =ISA_DEVICE (dev);ISADebugconState *isa =ISA_DEBUGCON_DEVICE (dev);DebugconState *s = &isa->state; -Error *err =NULL ; -debugcon_realize_core (s, &err); -if (err !=NULL ) { -error_propagate (errp, err); +debugcon_realize_core (s, errp); +if (ERR_IS_SET (errp)) {return ; } memory_region_init_io(&s->io, OBJECT(dev), &debugcon_ops, s,
hw/char/serial-pci.c +4 -8
@@ -55,12 +55,10 @@ static void serial_pci_realize(PCIDevice *dev, Error **errp) {PCISerialState *pci =DO_UPCAST (PCISerialState, dev, dev);SerialState *s = &pci->state; -Error *err =NULL ; s->baudbase =115200 ; -serial_realize_core (s, &err); -if (err !=NULL ) { -error_propagate (errp, err); +serial_realize_core (s, errp); +if (ERR_IS_SET (errp)) {return ; }
@@ -91,7 +89,6 @@ static void multi_serial_pci_realize(PCIDevice *dev, Error **errp)PCIDeviceClass *pc =PCI_DEVICE_GET_CLASS (dev);PCIMultiSerialState *pci =DO_UPCAST (PCIMultiSerialState, dev, dev);SerialState *s; -Error *err =NULL ;int i, nr_ports =0 ;switch (pc->device_id) {
@@ -115,9 +112,8 @@ static void multi_serial_pci_realize(PCIDevice *dev, Error **errp)for (i =0 ; i < nr_ports; i++) { s = pci->state + i; s->baudbase =115200 ; -serial_realize_core (s, &err); -if (err !=NULL ) { -error_propagate (errp, err); +serial_realize_core (s, errp); +if (ERR_IS_SET (errp)) {multi_serial_pci_exit (dev);return ; }
hw/char/virtio-serial-bus.c +2 -4
@@ -926,7 +926,6 @@ static void virtser_port_device_realize(DeviceState *dev, Error **errp)VirtIOSerialBus *bus =VIRTIO_SERIAL_BUS (qdev_get_parent_bus (dev));int max_nr_ports;bool plugging_port0; -Error *err =NULL ; port->vser = bus->vser; port->bh =qemu_bh_new (flush_queued_data_bh, port);
@@ -972,9 +971,8 @@ static void virtser_port_device_realize(DeviceState *dev, Error **errp)return ; } - vsc->realize (dev, &err); -if (err !=NULL ) { -error_propagate (errp, err); + vsc->realize (dev, errp); +if (ERR_IS_SET (errp)) {return ; }
hw/core/machine.c +4 -8
@@ -91,12 +91,10 @@ static void machine_set_kvm_shadow_mem(Object *obj, Visitor *v, Error **errp) {MachineState *ms =MACHINE (obj); -Error *error =NULL ;int64_t value; -visit_type_int (v, name, &value, &error); -if (error) { -error_propagate (errp, error); +visit_type_int (v, name, &value, errp); +if (ERR_IS_SET (errp)) {return ; }
@@ -193,12 +191,10 @@ static void machine_set_phandle_start(Object *obj, Visitor *v, Error **errp) {MachineState *ms =MACHINE (obj); -Error *error =NULL ;int64_t value; -visit_type_int (v, name, &value, &error); -if (error) { -error_propagate (errp, error); +visit_type_int (v, name, &value, errp); +if (ERR_IS_SET (errp)) {return ; }
hw/core/qdev-properties-system.c +8 -16
@@ -43,7 +43,6 @@ static void set_pointer(Object *obj, Visitor *v, Property *prop, const char *name, Error **errp) { DeviceState *dev = DEVICE(obj); -Error *local_err =NULL ;void **ptr =qdev_get_prop_ptr (dev, prop);char *str;
@@ -52,9 +51,8 @@ static void set_pointer(Object *obj, Visitor *v, Property *prop,return ; } -visit_type_str (v, name, &str, &local_err); -if (local_err) { -error_propagate (errp, local_err); +visit_type_str (v, name, &str, errp); +if (ERR_IS_SET (errp)) {return ; }if (!*str) {
@@ -185,7 +183,6 @@ static void set_chr(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) {DeviceState *dev =DEVICE (obj); -Error *local_err =NULL ;Property *prop = opaque;CharBackend *be =qdev_get_prop_ptr (dev, prop);Chardev *s;
@@ -196,9 +193,8 @@ static void set_chr(Object *obj, Visitor *v, const char *name, void *opaque,return ; } -visit_type_str (v, name, &str, &local_err); -if (local_err) { -error_propagate (errp, local_err); +visit_type_str (v, name, &str, errp); +if (ERR_IS_SET (errp)) {return ; }
@@ -257,7 +253,6 @@ static void set_netdev(Object *obj, Visitor *v, const char *name,NICPeers *peers_ptr =qdev_get_prop_ptr (dev, prop);NetClientState **ncs = peers_ptr->ncs;NetClientState *peers[MAX_QUEUE_NUM ]; -Error *local_err =NULL ;int queues, err =0 , i =0 ;char *str;
@@ -266,9 +261,8 @@ static void set_netdev(Object *obj, Visitor *v, const char *name,return ; } -visit_type_str (v, name, &str, &local_err); -if (local_err) { -error_propagate (errp, local_err); +visit_type_str (v, name, &str, errp); +if (ERR_IS_SET (errp)) {return ; }
@@ -361,7 +355,6 @@ static void set_vlan(Object *obj, Visitor *v, const char *name, void *opaque,Property *prop = opaque;NICPeers *peers_ptr =qdev_get_prop_ptr (dev, prop);NetClientState **ptr = &peers_ptr->ncs[0 ]; -Error *local_err =NULL ;int32_t id;NetClientState *hubport;
@@ -370,9 +363,8 @@ static void set_vlan(Object *obj, Visitor *v, const char *name, void *opaque,return ; } -visit_type_int32 (v, name, &id, &local_err); -if (local_err) { -error_propagate (errp, local_err); +visit_type_int32 (v, name, &id, errp); +if (ERR_IS_SET (errp)) {return ; }if (id ==-1 ) {
hw/core/qdev-properties.c +16 -31
137 lines not on this page · raw message
hw/core/qdev.c +2 -4
@@ -768,7 +768,6 @@ static void qdev_property_add_legacy(DeviceState *dev, Property *prop,void qdev_property_add_static (DeviceState *dev,Property *prop,Error **errp) { -Error *local_err =NULL ;Object *obj =OBJECT (dev);/*
@@ -783,10 +782,9 @@ void qdev_property_add_static(DeviceState *dev, Property *prop,object_property_add (obj, prop->name, prop->info->name, prop->info->get, prop->info->set, prop->info->release, - prop, &local_err); + prop, errp); -if (local_err) { -error_propagate (errp, local_err); +if (ERR_IS_SET (errp)) {return ; }
hw/cpu/a15mpcore.c +2 -4
@@ -53,7 +53,6 @@ static void a15mp_priv_realize(DeviceState *dev, Error **errp)DeviceState *gicdev;SysBusDevice *busdev;int i; -Error *err =NULL ;bool has_el3;Object *cpuobj;
@@ -71,9 +70,8 @@ static void a15mp_priv_realize(DeviceState *dev, Error **errp)qdev_prop_set_bit (gicdev,"has-security-extensions" , has_el3); } -object_property_set_bool (OBJECT (&s->gic), true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->gic), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; } busdev =SYS_BUS_DEVICE (&s->gic);
hw/cpu/a9mpcore.c +10 -16
@@ -50,16 +50,14 @@ static void a9mp_priv_realize(DeviceState *dev, Error **errp)DeviceState *scudev, *gicdev, *gtimerdev, *mptimerdev, *wdtdev;SysBusDevice *scubusdev, *gicbusdev, *gtimerbusdev, *mptimerbusdev, *wdtbusdev; -Error *err =NULL ;int i;bool has_el3;Object *cpuobj; scudev =DEVICE (&s->scu);qdev_prop_set_uint32 (scudev,"num-cpu" , s->num_cpu); -object_property_set_bool (OBJECT (&s->scu), true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->scu), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; } scubusdev =SYS_BUS_DEVICE (&s->scu);
@@ -76,9 +74,8 @@ static void a9mp_priv_realize(DeviceState *dev, Error **errp)object_property_get_bool (cpuobj,"has_el3" , &error_abort);qdev_prop_set_bit (gicdev,"has-security-extensions" , has_el3); -object_property_set_bool (OBJECT (&s->gic), true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->gic), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; } gicbusdev =SYS_BUS_DEVICE (&s->gic);
@@ -91,27 +88,24 @@ static void a9mp_priv_realize(DeviceState *dev, Error **errp) gtimerdev =DEVICE (&s->gtimer);qdev_prop_set_uint32 (gtimerdev,"num-cpu" , s->num_cpu); -object_property_set_bool (OBJECT (&s->gtimer), true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->gtimer), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; } gtimerbusdev =SYS_BUS_DEVICE (&s->gtimer); mptimerdev =DEVICE (&s->mptimer);qdev_prop_set_uint32 (mptimerdev,"num-cpu" , s->num_cpu); -object_property_set_bool (OBJECT (&s->mptimer), true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->mptimer), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; } mptimerbusdev =SYS_BUS_DEVICE (&s->mptimer); wdtdev =DEVICE (&s->wdt);qdev_prop_set_uint32 (wdtdev,"num-cpu" , s->num_cpu); -object_property_set_bool (OBJECT (&s->wdt), true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->wdt), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; } wdtbusdev =SYS_BUS_DEVICE (&s->wdt);
hw/cpu/arm11mpcore.c +8 -13
@@ -72,20 +72,17 @@ static void mpcore_priv_realize(DeviceState *dev, Error **errp)DeviceState *gicdev =DEVICE (&s->gic);DeviceState *mptimerdev =DEVICE (&s->mptimer);DeviceState *wdtimerdev =DEVICE (&s->wdtimer); -Error *err =NULL ;qdev_prop_set_uint32 (scudev,"num-cpu" , s->num_cpu); -object_property_set_bool (OBJECT (&s->scu), true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->scu), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; }qdev_prop_set_uint32 (gicdev,"num-cpu" , s->num_cpu);qdev_prop_set_uint32 (gicdev,"num-irq" , s->num_irq); -object_property_set_bool (OBJECT (&s->gic), true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->gic), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; }
@@ -96,16 +93,14 @@ static void mpcore_priv_realize(DeviceState *dev, Error **errp)qdev_init_gpio_in (dev, mpcore_priv_set_irq, s->num_irq -32 );qdev_prop_set_uint32 (mptimerdev,"num-cpu" , s->num_cpu); -object_property_set_bool (OBJECT (&s->mptimer), true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->mptimer), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; }qdev_prop_set_uint32 (wdtimerdev,"num-cpu" , s->num_cpu); -object_property_set_bool (OBJECT (&s->wdtimer), true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->wdtimer), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; }
hw/cpu/core.c +4 -8
@@ -24,12 +24,10 @@ static void core_prop_set_core_id(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { CPUCore *core = CPU_CORE(obj); -Error *local_err =NULL ;int64_t value; -visit_type_int (v, name, &value, &local_err); -if (local_err) { -error_propagate (errp, local_err); +visit_type_int (v, name, &value, errp); +if (ERR_IS_SET (errp)) {return ; }
@@ -49,12 +47,10 @@ static void core_prop_set_nr_threads(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { CPUCore *core = CPU_CORE(obj); -Error *local_err =NULL ;int64_t value; -visit_type_int (v, name, &value, &local_err); -if (local_err) { -error_propagate (errp, local_err); +visit_type_int (v, name, &value, errp); +if (ERR_IS_SET (errp)) {return ; }
hw/cpu/realview_mpcore.c +4 -7
@@ -62,14 +62,12 @@ static void realview_mpcore_realize(DeviceState *dev, Error **errp)DeviceState *priv =DEVICE (&s->priv);DeviceState *gic;SysBusDevice *gicbusdev; -Error *err =NULL ;int n;int i;qdev_prop_set_uint32 (priv,"num-cpu" , s->num_cpu); -object_property_set_bool (OBJECT (&s->priv), true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->priv), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; }sysbus_pass_irq (sbd,SYS_BUS_DEVICE (&s->priv));
@@ -78,9 +76,8 @@ static void realview_mpcore_realize(DeviceState *dev, Error **errp) }/* ??? IRQ routing is hardcoded to "normal" mode. */ for (n =0 ; n <4 ; n++) { -object_property_set_bool (OBJECT (&s->gic[n]), true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->gic[n]), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; } gic =DEVICE (&s->gic[n]);
hw/display/qxl.c +2 -4
@@ -2163,7 +2163,6 @@ static void qxl_realize_primary(PCIDevice *dev, Error **errp) {PCIQXLDevice *qxl =PCI_QXL (dev);VGACommonState *vga = &qxl->vga; -Error *local_err =NULL ; qxl->id =0 ;qxl_init_ramsize (qxl);
@@ -2180,9 +2179,8 @@ static void qxl_realize_primary(PCIDevice *dev, Error **errp) vga->con =graphic_console_init (DEVICE (dev),0 , &qxl_ops, qxl);qemu_spice_display_init_common (&qxl->ssd); -qxl_realize_common (qxl, &local_err); -if (local_err) { -error_propagate (errp, local_err); +qxl_realize_common (qxl, errp); +if (ERR_IS_SET (errp)) {return ; }
hw/display/virtio-gpu.c +2 -4
@@ -1104,7 +1104,6 @@ static void virtio_gpu_device_realize(DeviceState *qdev, Error **errp)VirtIODevice *vdev =VIRTIO_DEVICE (qdev);VirtIOGPU *g =VIRTIO_GPU (qdev);bool have_virgl; -Error *local_err =NULL ;int i;if (g->conf.max_outputs >VIRTIO_GPU_MAX_SCANOUTS ) {
@@ -1124,9 +1123,8 @@ static void virtio_gpu_device_realize(DeviceState *qdev, Error **errp)if (virtio_gpu_virgl_enabled (g->conf)) {error_setg (&g->migration_blocker,"virgl is not yet migratable" ); -migrate_add_blocker (g->migration_blocker, &local_err); -if (local_err) { -error_propagate (errp, local_err); +migrate_add_blocker (g->migration_blocker, errp); +if (ERR_IS_SET (errp)) {error_free (g->migration_blocker);return ; }
hw/display/virtio-vga.c +2 -4
@@ -101,7 +101,6 @@ static void virtio_vga_realize(VirtIOPCIProxy *vpci_dev, Error **errp)VirtIOVGA *vvga =VIRTIO_VGA (vpci_dev);VirtIOGPU *g = &vvga->vdev;VGACommonState *vga = &vvga->vga; -Error *err =NULL ;uint32_t offset;int i;
@@ -146,9 +145,8 @@ static void virtio_vga_realize(VirtIOPCIProxy *vpci_dev, Error **errp)/* init virtio bits */ qdev_set_parent_bus (DEVICE (g),BUS (&vpci_dev->bus));virtio_pci_force_virtio_1 (vpci_dev); -object_property_set_bool (OBJECT (g), true,"realized" , &err); -if (err) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (g), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; }
hw/i386/kvm/pci-assign.c +2 -4
@@ -838,7 +838,6 @@ static int assign_intx(AssignedDevice *dev, Error **errp)PCIINTxRoute intx_route;bool intx_host_msi;int r; -Error *local_err =NULL ;/* Interrupt PIN 0 means don't use INTx */ if (assigned_dev_pci_read_byte (&dev->dev,PCI_INTERRUPT_PIN ) ==0 ) {
@@ -846,9 +845,8 @@ static int assign_intx(AssignedDevice *dev, Error **errp)return 0 ; } -verify_irqchip_in_kernel (&local_err); -if (local_err) { -error_propagate (errp, local_err); +verify_irqchip_in_kernel (errp); +if (ERR_IS_SET (errp)) {return -ENOTSUP ; }
hw/i386/pc.c +2 -4
@@ -1111,7 +1111,6 @@ void pc_hot_add_cpu(const int64_t id, Error **errp)ObjectClass *oc;MachineState *ms =MACHINE (qdev_get_machine ());int64_t apic_id =x86_cpu_apic_id_from_index (id); -Error *local_err =NULL ;if (id <0 ) {error_setg (errp,"Invalid CPU id: %" PRIi64, id);
@@ -1127,9 +1126,8 @@ void pc_hot_add_cpu(const int64_t id, Error **errp)assert (ms->possible_cpus->cpus[0 ].cpu);/* BSP is always present */ oc =OBJECT_CLASS (CPU_GET_CLASS (ms->possible_cpus->cpus[0 ].cpu)); -pc_new_cpu (object_class_get_name (oc), apic_id, &local_err); -if (local_err) { -error_propagate (errp, local_err); +pc_new_cpu (object_class_get_name (oc), apic_id, errp); +if (ERR_IS_SET (errp)) {return ; } }
hw/input/virtio-input.c +4 -8
@@ -235,12 +235,10 @@ static void virtio_input_device_realize(DeviceState *dev, Error **errp)VirtIODevice *vdev =VIRTIO_DEVICE (dev);VirtIOInput *vinput =VIRTIO_INPUT (dev);VirtIOInputConfig *cfg; -Error *local_err =NULL ;if (vic->realize) { - vic->realize (dev, &local_err); -if (local_err) { -error_propagate (errp, local_err); + vic->realize (dev, errp); +if (ERR_IS_SET (errp)) {return ; } }
@@ -278,12 +276,10 @@ static void virtio_input_device_unrealize(DeviceState *dev, Error **errp) {VirtIOInputClass *vic =VIRTIO_INPUT_GET_CLASS (dev);VirtIODevice *vdev =VIRTIO_DEVICE (dev); -Error *local_err =NULL ;if (vic->unrealize) { - vic->unrealize (dev, &local_err); -if (local_err) { -error_propagate (errp, local_err); + vic->unrealize (dev, errp); +if (ERR_IS_SET (errp)) {return ; } }
hw/intc/apic_common.c +2 -4
@@ -461,7 +461,6 @@ static void apic_common_set_id(Object *obj, Visitor *v, const char *name, {APICCommonState *s =APIC_COMMON (obj);DeviceState *dev =DEVICE (obj); -Error *local_err =NULL ;int64_t value;if (dev->realized) {
@@ -469,9 +468,8 @@ static void apic_common_set_id(Object *obj, Visitor *v, const char *name,return ; } -visit_type_int (v, name, &value, &local_err); -if (local_err) { -error_propagate (errp, local_err); +visit_type_int (v, name, &value, errp); +if (ERR_IS_SET (errp)) {return ; }
hw/intc/arm_gic.c +2 -4
@@ -1404,11 +1404,9 @@ static void arm_gic_realize(DeviceState *dev, Error **errp)GICState *s =ARM_GIC (dev);SysBusDevice *sbd =SYS_BUS_DEVICE (dev);ARMGICClass *agc =ARM_GIC_GET_CLASS (s); -Error *local_err =NULL ; - agc->parent_realize (dev, &local_err); -if (local_err) { -error_propagate (errp, local_err); + agc->parent_realize (dev, errp); +if (ERR_IS_SET (errp)) {return ; }
hw/intc/arm_gic_kvm.c +4 -7
@@ -495,12 +495,10 @@ static void kvm_arm_gic_realize(DeviceState *dev, Error **errp)int i;GICState *s =KVM_ARM_GIC (dev);KVMARMGICClass *kgc =KVM_ARM_GIC_GET_CLASS (s); -Error *local_err =NULL ;int ret; - kgc->parent_realize (dev, &local_err); -if (local_err) { -error_propagate (errp, local_err); + kgc->parent_realize (dev, errp); +if (ERR_IS_SET (errp)) {return ; }
@@ -513,9 +511,8 @@ static void kvm_arm_gic_realize(DeviceState *dev, Error **errp)if (!kvm_arm_gic_can_save_restore (s)) {error_setg (&s->migration_blocker,"This operating system kernel does " "not support vGICv2 migration" ); -migrate_add_blocker (s->migration_blocker, &local_err); -if (local_err) { -error_propagate (errp, local_err); +migrate_add_blocker (s->migration_blocker, errp); +if (ERR_IS_SET (errp)) {error_free (s->migration_blocker);return ; }
hw/intc/arm_gicv3.c +2 -4
@@ -365,11 +365,9 @@ static void arm_gic_realize(DeviceState *dev, Error **errp)/* Device instance realize function for the GIC sysbus device */ GICv3State *s =ARM_GICV3 (dev);ARMGICv3Class *agc =ARM_GICV3_GET_CLASS (s); -Error *local_err =NULL ; - agc->parent_realize (dev, &local_err); -if (local_err) { -error_propagate (errp, local_err); + agc->parent_realize (dev, errp); +if (ERR_IS_SET (errp)) {return ; }
hw/intc/arm_gicv3_its_kvm.c +2 -4
@@ -56,16 +56,14 @@ static int kvm_its_send_msi(GICv3ITSState *s, uint32_t value, uint16_t devid)static void kvm_arm_its_realize (DeviceState *dev,Error **errp) {GICv3ITSState *s =ARM_GICV3_ITS_COMMON (dev); -Error *local_err =NULL ;/* * Block migration of a KVM GICv3 ITS device: the API for saving and * restoring the state in the kernel is not yet available */ error_setg (&s->migration_blocker,"vITS migration is not implemented" ); -migrate_add_blocker (s->migration_blocker, &local_err); -if (local_err) { -error_propagate (errp, local_err); +migrate_add_blocker (s->migration_blocker, errp); +if (ERR_IS_SET (errp)) {error_free (s->migration_blocker);return ; }
hw/intc/arm_gicv3_kvm.c +4 -7
@@ -684,14 +684,12 @@ static void kvm_arm_gicv3_realize(DeviceState *dev, Error **errp) {GICv3State *s =KVM_ARM_GICV3 (dev);KVMARMGICv3Class *kgc =KVM_ARM_GICV3_GET_CLASS (s); -Error *local_err =NULL ;int i;DPRINTF ("kvm_arm_gicv3_realize\n" ); - kgc->parent_realize (dev, &local_err); -if (local_err) { -error_propagate (errp, local_err); + kgc->parent_realize (dev, errp); +if (ERR_IS_SET (errp)) {return ; }
@@ -744,9 +742,8 @@ static void kvm_arm_gicv3_realize(DeviceState *dev, Error **errp) GICD_CTLR)) {error_setg (&s->migration_blocker,"This operating system kernel does " "not support vGICv3 migration" ); -migrate_add_blocker (s->migration_blocker, &local_err); -if (local_err) { -error_propagate (errp, local_err); +migrate_add_blocker (s->migration_blocker, errp); +if (ERR_IS_SET (errp)) {error_free (s->migration_blocker);return ; }
hw/intc/armv7m_nvic.c +2 -4
@@ -1003,7 +1003,6 @@ static void armv7m_nvic_realize(DeviceState *dev, Error **errp) {NVICState *s =NVIC (dev);SysBusDevice *systick_sbd; -Error *err =NULL ; s->cpu =ARM_CPU (qemu_get_cpu (0 ));assert (s->cpu);
@@ -1018,9 +1017,8 @@ static void armv7m_nvic_realize(DeviceState *dev, Error **errp)/* include space for internal exception vectors */ s->num_irq +=NVIC_FIRST_IRQ ; -object_property_set_bool (OBJECT (&s->systick), true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->systick), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; } systick_sbd =SYS_BUS_DEVICE (&s->systick);
hw/intc/realview_gic.c +2 -4
@@ -23,7 +23,6 @@ static void realview_gic_realize(DeviceState *dev, Error **errp)SysBusDevice *sbd =SYS_BUS_DEVICE (dev);RealViewGICState *s =REALVIEW_GIC (dev);SysBusDevice *busdev; -Error *err =NULL ;/* The GICs on the RealView boards have a fixed nonconfigurable * number of interrupt lines, so we don't need to expose this as * a qdev property.
@@ -31,9 +30,8 @@ static void realview_gic_realize(DeviceState *dev, Error **errp)int numirq =96 ;qdev_prop_set_uint32 (DEVICE (&s->gic),"num-irq" , numirq); -object_property_set_bool (OBJECT (&s->gic), true,"realized" , &err); -if (err !=NULL ) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->gic), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; } busdev =SYS_BUS_DEVICE (&s->gic);
hw/ipack/ipack.c +1 -3
@@ -60,11 +60,9 @@ static void ipack_device_unrealize(DeviceState *dev, Error **errp) {IPackDevice *idev =IPACK_DEVICE (dev);IPackDeviceClass *k =IPACK_DEVICE_GET_CLASS (dev); -Error *err =NULL ;if (k->unrealize) { - k->unrealize (dev, &err); -error_propagate (errp, err); + k->unrealize (dev, errp);return ; }
hw/misc/ivshmem.c +6 -12
@@ -463,7 +463,6 @@ static void setup_interrupt(IVShmemState *s, int vector, Error **errp)bool with_irqfd =kvm_msi_via_irqfd_enabled () &&ivshmem_has_feature (s,IVSHMEM_MSI );PCIDevice *pdev =PCI_DEVICE (s); -Error *err =NULL ;IVSHMEM_DPRINTF ("setting up interrupt for vector: %d\n" , vector);
@@ -472,9 +471,8 @@ static void setup_interrupt(IVShmemState *s, int vector, Error **errp)watch_vector_notifier (s, n, vector); }else if (msix_enabled (pdev)) {IVSHMEM_DPRINTF ("with irqfd\n" ); -ivshmem_add_kvm_msi_virq (s, vector, &err); -if (err) { -error_propagate (errp, err); +ivshmem_add_kvm_msi_virq (s, vector, errp); +if (ERR_IS_SET (errp)) {return ; }
@@ -836,11 +834,9 @@ static void ivshmem_write_config(PCIDevice *pdev, uint32_t address,static void ivshmem_common_realize (PCIDevice *dev,Error **errp) {IVShmemState *s =IVSHMEM_COMMON (dev); -Error *err =NULL ;uint8_t *pci_conf;uint8_t attr =PCI_BASE_ADDRESS_SPACE_MEMORY |PCI_BASE_ADDRESS_MEM_PREFETCH ; -Error *local_err =NULL ;/* IRQFD requires MSI */ if (ivshmem_has_feature(s, IVSHMEM_IOEVENTFD) &&
@@ -883,9 +879,8 @@ static void ivshmem_common_realize(PCIDevice *dev, Error **errp)* Older versions did it asynchronously, but that creates a * number of entertaining race conditions. */ -ivshmem_recv_setup (s, &err); -if (err) { -error_propagate (errp, err); +ivshmem_recv_setup (s, errp); +if (ERR_IS_SET (errp)) {return ; }
@@ -911,9 +906,8 @@ static void ivshmem_common_realize(PCIDevice *dev, Error **errp)if (!ivshmem_is_master (s)) {error_setg (&s->migration_blocker,"Migration is disabled when using feature 'peer mode' in device 'ivshmem'" ); -migrate_add_blocker (s->migration_blocker, &local_err); -if (local_err) { -error_propagate (errp, local_err); +migrate_add_blocker (s->migration_blocker, errp); +if (ERR_IS_SET (errp)) {error_free (s->migration_blocker);return ; }
hw/misc/macio/macio.c +12 -21
@@ -126,15 +126,13 @@ static void macio_common_realize(PCIDevice *d, Error **errp) {MacIOState *s =MACIO (d);SysBusDevice *sysbus_dev; -Error *err =NULL ;MemoryRegion *dbdma_mem; s->dbdma =DBDMA_init (&dbdma_mem);memory_region_add_subregion (&s->bar,0x08000 , dbdma_mem); -object_property_set_bool (OBJECT (&s->cuda), true,"realized" , &err); -if (err) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&s->cuda), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; } sysbus_dev =SYS_BUS_DEVICE (&s->cuda);
@@ -162,23 +160,20 @@ static void macio_oldworld_realize(PCIDevice *d, Error **errp) {MacIOState *s =MACIO (d);OldWorldMacIOState *os =OLDWORLD_MACIO (d); -Error *err =NULL ;SysBusDevice *sysbus_dev;int i;int cur_irq =0 ; -macio_common_realize (d, &err); -if (err) { -error_propagate (errp, err); +macio_common_realize (d, errp); +if (ERR_IS_SET (errp)) {return ; } sysbus_dev =SYS_BUS_DEVICE (&s->cuda);sysbus_connect_irq (sysbus_dev,0 , os->irqs[cur_irq++]); -object_property_set_bool (OBJECT (&os->nvram), true,"realized" , &err); -if (err) { -error_propagate (errp, err); +object_property_set_bool (OBJECT (&os->nvram), true,"realized" , errp); +if (ERR_IS_SET (errp)) {return ; }
Lines of this file are not shown. View the raw message.
qga/commands-posix.c +26 -54
80 lines not on this page · raw message
qom/object.c +28 -56
84 lines not on this page · raw message
target/i386/cpu.c +14 -28
42 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.11.0.259.g40922b1
Part of the diff is not shown here. View the raw message.