qemu-e2k/include
Markus Armbruster 3e80f6902c qdev: Convert uses of qdev_create() with Coccinelle
This is the transformation explained in the commit before previous.
Takes care of just one pattern that needs conversion.  More to come in
this series.

Coccinelle script:

    @ depends on !(file in "hw/arm/highbank.c")@
    expression bus, type_name, dev, expr;
    @@
    -    dev = qdev_create(bus, type_name);
    +    dev = qdev_new(type_name);
         ... when != dev = expr
    -    qdev_init_nofail(dev);
    +    qdev_realize_and_unref(dev, bus, &error_fatal);

    @@
    expression bus, type_name, dev, expr;
    identifier DOWN;
    @@
    -    dev = DOWN(qdev_create(bus, type_name));
    +    dev = DOWN(qdev_new(type_name));
         ... when != dev = expr
    -    qdev_init_nofail(DEVICE(dev));
    +    qdev_realize_and_unref(DEVICE(dev), bus, &error_fatal);

    @@
    expression bus, type_name, expr;
    identifier dev;
    @@
    -    DeviceState *dev = qdev_create(bus, type_name);
    +    DeviceState *dev = qdev_new(type_name);
         ... when != dev = expr
    -    qdev_init_nofail(dev);
    +    qdev_realize_and_unref(dev, bus, &error_fatal);

    @@
    expression bus, type_name, dev, expr, errp;
    symbol true;
    @@
    -    dev = qdev_create(bus, type_name);
    +    dev = qdev_new(type_name);
         ... when != dev = expr
    -    object_property_set_bool(OBJECT(dev), true, "realized", errp);
    +    qdev_realize_and_unref(dev, bus, errp);

    @@
    expression bus, type_name, expr, errp;
    identifier dev;
    symbol true;
    @@
    -    DeviceState *dev = qdev_create(bus, type_name);
    +    DeviceState *dev = qdev_new(type_name);
         ... when != dev = expr
    -    object_property_set_bool(OBJECT(dev), true, "realized", errp);
    +    qdev_realize_and_unref(dev, bus, errp);

The first rule exempts hw/arm/highbank.c, because it matches along two
control flow paths there, with different @type_name.  Covered by the
next commit's manual conversions.

Missing #include "qapi/error.h" added manually.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-10-armbru@redhat.com>
[Conflicts in hw/misc/empty_slot.c and hw/sparc/leon3.c resolved]
2020-06-15 22:00:10 +02:00
..
authz
block block/dirty-bitmap: add bdrv_has_named_bitmaps helper 2020-05-28 13:15:22 -05:00
chardev
crypto
disas disas: include an optional note for the start of disassembly 2020-05-15 15:25:16 +01:00
exec exec/cpu-common: Move MUSB specific typedefs to 'hw/usb/hcd-musb.h' 2020-06-12 11:20:15 -04:00
fpu softfloat: Return bool from all classification predicates 2020-05-19 08:43:05 -07:00
hw qdev: Convert uses of qdev_create() with Coccinelle 2020-06-15 22:00:10 +02:00
io io/task: Move 'qom/object.h' header to source 2020-06-10 12:09:37 -04:00
libdecnumber
migration migration/vmstate: Remove unnecessary MemoryRegion forward declaration 2020-06-01 18:44:27 +01:00
monitor hmp: Implement qom-get HMP command 2020-06-01 18:44:27 +01:00
net hw/net/can: Make CanBusClientInfo::can_receive() return a boolean 2020-03-31 21:14:35 +08:00
qapi qapi: Only input visitors can actually fail 2020-04-30 07:26:40 +02:00
qemu * Miscellaneous fixes and feature enablement (many) 2020-06-12 23:06:22 +01:00
qom qom: Constify object_get_canonical_path{,_component}()'s parameter 2020-06-15 21:34:25 +02:00
scsi
standard-headers linux-headers: update against Linux 5.7-rc3 2020-04-28 12:29:01 +02:00
sysemu * Miscellaneous fixes and feature enablement (many) 2020-06-12 23:06:22 +01:00
tcg tcg: Implement gvec support for rotate by scalar 2020-06-02 08:42:37 -07:00
ui ui/win32-kbd-hook: handle AltGr in a hook procedure 2020-05-19 09:06:44 +02:00
user
elf.h
glib-compat.h
qemu-common.h
qemu-io.h
trace-tcg.h