qemu-patch-raspberry4/include
Daniel P. Berrangé c490af57cb util: introduce qemu_open and qemu_create with error reporting
qemu_open_old() works like open(): set errno and return -1 on failure.
It has even more failure modes, though.  Reporting the error clearly
to users is basically impossible for many of them.

Our standard cure for "errno is too coarse" is the Error object.
Introduce two new helper methods:

  int qemu_open(const char *name, int flags, Error **errp);
  int qemu_create(const char *name, int flags, mode_t mode, Error **errp);

Note that with this design we no longer require or even accept the
O_CREAT flag. Avoiding overloading the two distinct operations
means we can avoid variable arguments which would prevent 'errp' from
being the last argument. It also gives us a guarantee that the 'mode' is
given when creating files, avoiding a latent security bug.

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-09-16 10:33:48 +01:00
..
authz Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-09 09:27:11 -04:00
block QOM boilerplate cleanup 2020-09-11 19:26:51 +01:00
chardev Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
crypto Improve performance of crypto cipher subsystem 2020-09-12 21:17:22 +01:00
disas target/avr: Register AVR support with the rest of QEMU 2020-07-11 11:02:05 +02:00
exec Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
fpu softfloat: Define comparison operations for bfloat16 2020-08-29 19:25:42 -07:00
hw virtio-gpu: make virtio_gpu_ops static 2020-09-15 14:11:49 +02:00
io Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-09 09:27:11 -04:00
libdecnumber include: Make headers more self-contained 2019-08-16 13:31:51 +02:00
migration migration/colo: Use ram_block_discard_disable() 2020-07-02 05:54:59 -04:00
monitor monitor: simplify functions for getting a dup'd fdset entry 2020-09-16 10:33:48 +01:00
net Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
qapi qapi/error: Check format string argument in error_*prepend() 2020-07-24 15:03:09 +02:00
qemu util: introduce qemu_open and qemu_create with error reporting 2020-09-16 10:33:48 +01:00
qom Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
scsi Use OBJECT_DECLARE_TYPE where possible 2020-09-09 09:27:11 -04:00
standard-headers Linux headers: update 2020-06-18 12:13:36 +02:00
sysemu Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-09 09:27:11 -04:00
tcg tcg: Add tcg_get_insn_start_param 2020-09-01 07:43:30 -07:00
ui Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
user trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
elf.h Update PowerPC AT_HWCAP2 definition 2020-08-12 13:16:27 +10:00
glib-compat.h glib: bump min required glib library version to 2.48 2019-08-22 10:46:34 +01:00
qemu-common.h util/hexdump: Reorder qemu_hexdump() arguments 2020-09-11 21:25:59 +02:00
qemu-io.h Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
trace-tcg.h trace: get rid of generated-events.h/generated-events.c 2016-10-12 09:54:52 +02:00