Markus Armbruster
96927c744f
isa: Convert uses of isa_create() with Coccinelle
Replace
dev = isa_create(bus, type_name);
...
qdev_init_nofail(dev);
by
dev = isa_new(type_name);
...
isa_realize_and_unref(dev, bus, &error_fatal);
Recent commit "qdev: New qdev_new(), qdev_realize(), etc." explains
why.
Coccinelle script:
@@
expression dev, bus, expr;
expression list args;
expression d;
@@
- dev = isa_create(bus, args);
+ dev = isa_new(args);
(
d = &dev->qdev;
|
d = DEVICE(dev);
)
... when != dev = expr
- qdev_init_nofail(d);
+ isa_realize_and_unref(dev, bus, &error_fatal);
@@
expression dev, bus, expr;
expression list args;
@@
- dev = isa_create(bus, args);
+ dev = isa_new(args);
... when != dev = expr
- qdev_init_nofail(DEVICE(dev));
+ isa_realize_and_unref(dev, bus, &error_fatal);
@@
expression dev, bus, expr;
expression list args;
@@
- dev = DEVICE(isa_create(bus, args));
+ ISADevice *isa_dev; // TODO move
+ isa_dev = isa_new(args);
+ dev = DEVICE(isa_dev);
... when != dev = expr
- qdev_init_nofail(dev);
+ isa_realize_and_unref(isa_dev, bus, &error_fatal);
Missing #include "qapi/error.h" added manually, whitespace changes
minimized manually.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200610053247.1583243-20-armbru@redhat.com>
2020-06-15 22:05:28 +02:00
..
2019-08-16 13:31:53 +02:00
2020-05-15 07:08:14 +02:00
2020-05-15 07:08:14 +02:00
2020-02-28 16:14:57 +00:00
2020-02-28 16:14:57 +00:00
2020-02-28 16:14:57 +00:00
2020-01-24 20:59:15 +01:00
2020-01-24 20:59:15 +01:00
2020-01-17 14:27:16 +00:00
2019-06-17 15:13:19 +01:00
2019-08-16 13:31:52 +02:00
2020-01-24 20:59:15 +01:00
2020-04-30 11:52:27 +01:00
2019-06-17 15:13:19 +01:00
2019-06-12 13:18:33 +02:00
2020-03-12 16:01:37 +00:00
2019-08-16 13:31:52 +02:00
2020-03-23 17:22:30 +00:00
2020-03-23 17:22:30 +00:00
2020-01-07 17:24:29 +04:00
2020-01-24 20:59:15 +01:00
2020-06-15 22:00:10 +02:00
2018-09-25 15:13:24 +01:00
2017-02-28 17:10:00 +00:00
2020-01-07 17:24:29 +04:00
2019-08-16 13:31:52 +02:00
2020-06-15 22:05:28 +02:00
2019-12-17 19:33:49 +01:00
2019-08-16 13:31:52 +02:00
2019-08-16 13:31:52 +02:00
2019-08-16 13:31:52 +02:00
2020-06-10 12:10:33 -04:00
2020-01-07 12:08:39 +01:00
2019-08-16 13:31:52 +02:00
2019-08-19 21:28:25 +02:00
2020-01-24 20:59:15 +01:00
2019-08-16 13:31:52 +02:00
2020-01-24 20:59:15 +01:00
2020-01-24 20:59:15 +01:00
2020-01-24 20:59:15 +01:00
2020-01-24 20:59:15 +01:00
2019-08-16 13:31:52 +02:00
2019-03-12 14:33:04 +11:00
2020-01-24 20:59:15 +01:00
2020-06-09 19:01:56 +02:00
2019-08-16 13:31:53 +02:00
2020-01-27 12:13:09 +01:00
2020-06-15 22:00:10 +02:00
2019-08-16 13:31:52 +02:00
2019-08-16 13:31:52 +02:00
2020-01-08 11:01:59 +11:00
2020-03-17 15:08:50 +11:00
2019-10-04 19:08:22 +10:00
2019-12-17 10:39:48 +11:00
2019-08-16 13:31:53 +02:00
2019-12-17 10:39:48 +11:00
2020-05-15 07:08:14 +02:00
2020-01-24 20:59:15 +01:00
2020-05-15 07:07:58 +02:00
2020-01-24 20:59:15 +01:00
2019-08-16 13:31:52 +02:00